]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Use UTC for apt_key2 created and expiry
authorjames-stocks <james.stocks@puppetlabs.com>
Mon, 25 Sep 2017 13:57:07 +0000 (13:57 +0000)
committerjames-stocks <james.stocks@puppetlabs.com>
Mon, 25 Sep 2017 13:57:07 +0000 (13:57 +0000)
lib/puppet/provider/apt_key2/apt_key2.rb
spec/unit/puppet/provider/apt_key2/apt_key2_spec.rb

index ff810b42ba094ab6ec4e6c14c8d8ed9fb818876b..6ebdd7e042506790334f693c6c7d44e3188de98c 100644 (file)
@@ -91,7 +91,7 @@ class Puppet::Provider::AptKey2::AptKey2
                 end
 
     fingerprint = fpr_split.last
-    expiry      = pub_split[6].empty? ? nil : Time.at(pub_split[6].to_i)
+    expiry      = pub_split[6].empty? ? nil : Time.at(pub_split[6].to_i).utc
 
     {
       ensure:      'present',
@@ -102,7 +102,7 @@ class Puppet::Provider::AptKey2::AptKey2
       short:       fingerprint[-8..-1], # last 8 characters of fingerprint
       size:        pub_split[2].to_i,
       type:        key_type,
-      created:     Time.at(pub_split[5].to_i).to_s,
+      created:     Time.at(pub_split[5].to_i).utc.to_s,
       expiry:      expiry.to_s,
       expired:     (expiry && Time.now >= expiry) ? true : false,
     }
index 5b4aaf449f021d36a564f0d3b3dd26f885368714..0b108c39b1bf3ebf5a0e5c0db82ea839cad2225a 100644 (file)
@@ -107,8 +107,8 @@ EOS
           short: '8AE22BA9',
           size: 4096,
           type: :rsa,
-          created: '2017-05-22 19:41:53 +0100',
-          expiry: '2025-05-20 19:41:53 +0100',
+          created: '2017-05-22 18:41:53 UTC',
+          expiry: '2025-05-20 18:41:53 UTC',
           expired: false },
         { ensure: 'present',
           name: '126C0D24BD8A2942CC7DF8AC7638D0442B90D010',
@@ -118,8 +118,8 @@ EOS
           short: '2B90D010',
           size: 4096,
           type: :rsa,
-          created: '2014-11-21 21:01:13 +0000',
-          expiry: '2022-11-19 21:01:13 +0000',
+          created: '2014-11-21 21:01:13 UTC',
+          expiry: '2022-11-19 21:01:13 UTC',
           expired: false },
       ]
     end