def detach(self, export): try: client = cinderclient.get_conn(self.conf, tenant_id=export.volume.account_id) client.detach(export.id) client.terminate_connection(export.id) except cinderclient.CinderError, e: log.error("While detaching %s - %s" % (export.id, e))
def test_get_conn_from_config(self): conf = LunrConfig({ 'cinder': { 'username': '******', 'password': '******', 'auth_url': 'https://auth', 'cinder_url': 'https:cinder', 'rax_auth': 'true', } }) client = cinderclient.get_conn(conf) self.assertEquals(client.username, 'johnny') self.assertEquals(client.password, 'admin')