Commit fa8b6cf8 authored by paz's avatar paz

cli-refresh: don't report unchanged keys.

Reporting unchanged keys makes sense in the output of fetch_key(), but
less in the output of refresh_key().
parent 9e13ee38
......@@ -14,6 +14,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
* Do not enable delivery for admins that weren't members in v2 lists. (#213)
* Don't fail on importing v2 lists where admins do not have a proper key. (#207)
* Don't fail on adding prefix to an empty subject (#226)
* Don't report unchanged keys when refreshing keys.
## [3.1.0] / 2017-05-21
......
......@@ -82,7 +82,11 @@ module GPGME
refresh_key_filter_messages(gpgout).grep(/^gpgkeys: /)
].flatten.compact.join("\n")
else
translate_output('key_updated', gpgout)
lines = translate_output('key_updated', gpgout).reject do |line|
# Reduce the noise a little.
line.match(/.* \(unchanged\)\.$/)
end
lines.join("\n")
end
end
......@@ -96,7 +100,7 @@ module GPGME
if exitcode > 0 || gpgerr.grep(/ unable to fetch /).presence
"Fetching #{input} did not succeed:\n#{gpgerr.join("\n")}"
else
translate_output('key_fetched', gpgout)
translate_output('key_fetched', gpgout).join("\n")
end
end
......@@ -121,7 +125,7 @@ module GPGME
I18n.t(locale_key, { fingerprint: fingerprint,
states: states.join(', ') })
end
strings.join("\n")
strings
end
def translate_import_data(gpgoutput)
......
......@@ -147,7 +147,7 @@ describe 'cli' do
mail = Mail::TestMailer.deliveries.first
expect(Mail::TestMailer.deliveries.length).to eq 1
expect(mail.first_plaintext_part.body.to_s).to eql("Refreshing all keys from the keyring of list #{list.email} resulted in this:\n\nKey 59C71FB38AEE22E091C78259D06350440F759BD3 was updated (unchanged).\nKey 98769E8A1091F36BD88403ECF71A3F8412D83889 was updated (new signatures).\nKey 6EE51D78FD0B33DE65CCF69D2104E20E20889F66 was updated (new user-IDs, new signatures).")
expect(mail.first_plaintext_part.body.to_s).to eql("Refreshing all keys from the keyring of list #{list.email} resulted in this:\n\nKey 98769E8A1091F36BD88403ECF71A3F8412D83889 was updated (new signatures).\nKey 6EE51D78FD0B33DE65CCF69D2104E20E20889F66 was updated (new user-IDs, new signatures).")
teardown_list_and_mailer(list)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment