def create_cinder(self): """ Use pre-initialized session to create an instance of cinder client. :return: cinderclient instance """ self.cinder = cinder_client(self.volume_version, session=self.sess, **self.client_kwargs) return self.cinder
def create_cinder(self): """ Use pre-initialized session to create an instance of cinder client. :return: cinderclient instance """ self.cinder = cinder_client(self.volume_version, session=self.sess, **self.client_kwargs) return self.cinder
def get_to_cinder_client(self): auth_ref = self.get_to_auth_ref() project_id = auth_ref.session.get_project_id() endpoint_url = ('{ip}:8776/v2/{project_id}'.format (ip=self.to_auth_ip, project_id=project_id)) cinder = cinder_client('2', session=auth_ref.session, bypass_url=endpoint_url) cinder.client.management_url = endpoint_url return cinder
def get_to_cinder_client(self): auth_ref = self.get_to_auth_ref() project_id = auth_ref.session.get_project_id() endpoint_url = ('{ip}:{port}/v2/{project_id}'.format (ip=self.to_auth_ip, port=self.to_cinder_port, project_id=project_id)) cinder = cinder_client('2', session=auth_ref.session, bypass_url=endpoint_url) cinder.client.management_url = endpoint_url return cinder
def get_from_cinder_client_keystone3(self): auth_ref = self.get_from_auth_ref() project_id = auth_ref.session.get_project_id() endpoint_url = ('{ip}:{port}/v{version}/{project_id}'.format (ip=self.from_auth_ip, port=self.from_cinder_port, version=self.from_cinder_version, project_id=project_id)) cinder = cinder_client(self.from_cinder_version, session=auth_ref.session, bypass_url=endpoint_url) cinder.client.management_url = endpoint_url return cinder
def get_from_cinder_client_keystone3(self): auth_ref = self.get_from_auth_ref() project_id = auth_ref.session.get_project_id() endpoint_url = ('{ip}:{port}/v{version}/{project_id}'.format( ip=self.from_auth_ip, port=self.from_cinder_port, version=self.from_cinder_version, project_id=project_id)) cinder = cinder_client(self.from_cinder_version, session=auth_ref.session, bypass_url=endpoint_url) cinder.client.management_url = endpoint_url return cinder
def get_to_cinder_client(self): auth_ref = self.get_to_auth_ref() token = auth_ref['token']['id'] tenant_id = auth_ref['token']['tenant']['id'] endpoint_url = ('http://{ip}:8776/v1/{tenant}'.format (ip=self.to_auth_ip, tenant=tenant_id)) cinder = cinder_client('1', self.to_username, token, project_id=self.to_tenant_name, auth_url=self.to_auth_url) cinder.client.auth_token = token cinder.client.management_url = endpoint_url return cinder
def get_from_cinder_client_keystone2(self): auth_ref = self.get_from_auth_ref().auth_ref # auth_ref = self.get_from_auth_ref() token = auth_ref['token']['id'] tenant_id = auth_ref['token']['tenant']['id'] endpoint_url = ('{ip}:{port}/v1/{tenant}'.format (ip=self.from_auth_ip, port=self.from_cinder_port, tenant=tenant_id)) print endpoint_url cinder = cinder_client('1', self.from_username, token, project_id=self.from_tenant_name, auth_url=self.from_auth_url, cacert=self.from_cert) cinder.client.auth_token = token cinder.client.management_url = endpoint_url return cinder
def get_from_cinder_client_keystone2(self): auth_ref = self.get_from_auth_ref().auth_ref # auth_ref = self.get_from_auth_ref() token = auth_ref['token']['id'] tenant_id = auth_ref['token']['tenant']['id'] endpoint_url = ('{ip}:{port}/v1/{tenant}'.format( ip=self.from_auth_ip, port=self.from_cinder_port, tenant=tenant_id)) print endpoint_url cinder = cinder_client('1', self.from_username, token, project_id=self.from_tenant_name, auth_url=self.from_auth_url, cacert=self.from_cert) cinder.client.auth_token = token cinder.client.management_url = endpoint_url return cinder
def __init__(self, creds): self.cinderclient = cinder_client(2, **creds)