Merge "Fix Snakeoil to return expiration timestamp in string format"
This commit is contained in:
commit
9a8cbf7897
@ -439,7 +439,7 @@ class SnakeoilCACertificatePlugin(cert_manager.CertificatePluginBase):
|
||||
cert_manager.INFO_NAME: new_ca.name,
|
||||
cert_manager.INFO_CA_SIGNING_CERT: crypto.dump_certificate(
|
||||
crypto.FILETYPE_PEM, new_ca.cert),
|
||||
cert_manager.INFO_EXPIRATION: expiration,
|
||||
cert_manager.INFO_EXPIRATION: expiration.isoformat(),
|
||||
cert_manager.INFO_INTERMEDIATES: new_ca.pkcs7,
|
||||
cert_manager.PLUGIN_CA_ID: new_ca_id
|
||||
}
|
||||
@ -455,7 +455,7 @@ class SnakeoilCACertificatePlugin(cert_manager.CertificatePluginBase):
|
||||
cert_manager.INFO_CA_SIGNING_CERT: crypto.dump_certificate(
|
||||
crypto.FILETYPE_PEM, ca.cert),
|
||||
cert_manager.INFO_INTERMEDIATES: ca.pkcs7,
|
||||
cert_manager.INFO_EXPIRATION: expiration
|
||||
cert_manager.INFO_EXPIRATION: expiration.isoformat()
|
||||
}
|
||||
ret[ca_id] = ca_info
|
||||
|
||||
|
@ -418,6 +418,7 @@ class SnakeoilCAPluginTestCase(BaseTestCase):
|
||||
self.assertIsNotNone(ca_dict)
|
||||
self.assertEqual(self.plugin.ca.name, ca_dict.get(cm.INFO_NAME))
|
||||
self.assertIsNotNone(ca_dict.get(cm.INFO_CA_SIGNING_CERT))
|
||||
self.assertEqual(str, type(ca_dict.get(cm.INFO_EXPIRATION)))
|
||||
|
||||
def test_get_ca_info_with_subca(self):
|
||||
subca_dict = self._create_subca()
|
||||
@ -425,3 +426,4 @@ class SnakeoilCAPluginTestCase(BaseTestCase):
|
||||
ca_info = self.plugin.get_ca_info()
|
||||
self.assertIn(subca_id, ca_info.keys())
|
||||
self.assertIn(self.plugin.get_default_ca_name(), ca_info.keys())
|
||||
self.assertEqual(str, type(subca_dict.get(cm.INFO_EXPIRATION)))
|
||||
|
Loading…
Reference in New Issue
Block a user