def test_import_keystone_cert(self, check_call): self.relation_get.return_value = 'Zm9vX2NlcnQK' with patch_open() as (_open, _file): utils.import_keystone_ca_cert() _open.assert_called_with(utils.CA_CERT_PATH, 'wb') _file.write.assert_called_with('foo_cert\n') check_call.assert_called_with(['update-ca-certificates'])
def compute_changed(): # rewriting all configs to pick up possible net or vol manager # config advertised from controller. CONFIGS.write_all() import_authorized_keys() import_authorized_keys(user='******', prefix='nova') import_keystone_ca_cert()
def compute_changed(): # rewriting all configs to pick up possible net or vol manager # config advertised from controller. CONFIGS.write_all() import_authorized_keys() import_keystone_ca_cert() if (network_manager() in ['quantum', 'neutron'] and neutron_plugin() == 'ovs'): # in case we already have a database relation, need to request # access to the additional neutron database. [db_joined(rid) for rid in relation_ids('shared-db')]
def test_import_keystone_cert_missing_data(self, check_call): self.relation_get.return_value = None with patch_open() as (_open, _file): utils.import_keystone_ca_cert() self.assertFalse(_open.called) self.assertFalse(check_call.called)