Merge "Allow kwargs in create_keypair"
This commit is contained in:
commit
c02c2846ed
|
@ -160,7 +160,7 @@ class ScenarioTest(tempest.test.BaseTestCase):
|
||||||
client.delete_port, port['id'])
|
client.delete_port, port['id'])
|
||||||
return port
|
return port
|
||||||
|
|
||||||
def create_keypair(self, client=None):
|
def create_keypair(self, client=None, **kwargs):
|
||||||
"""Creates keypair
|
"""Creates keypair
|
||||||
|
|
||||||
Keypair is a public key of OpenSSH key pair used for accessing
|
Keypair is a public key of OpenSSH key pair used for accessing
|
||||||
|
@ -170,10 +170,11 @@ class ScenarioTest(tempest.test.BaseTestCase):
|
||||||
"""
|
"""
|
||||||
if not client:
|
if not client:
|
||||||
client = self.keypairs_client
|
client = self.keypairs_client
|
||||||
name = data_utils.rand_name(self.__class__.__name__)
|
if not kwargs.get('name'):
|
||||||
|
kwargs['name'] = data_utils.rand_name(self.__class__.__name__)
|
||||||
# We don't need to create a keypair by pubkey in scenario
|
# We don't need to create a keypair by pubkey in scenario
|
||||||
body = client.create_keypair(name=name)
|
body = client.create_keypair(**kwargs)
|
||||||
self.addCleanup(client.delete_keypair, name)
|
self.addCleanup(client.delete_keypair, kwargs['name'])
|
||||||
return body['keypair']
|
return body['keypair']
|
||||||
|
|
||||||
def create_server(self, name=None, image_id=None, flavor=None,
|
def create_server(self, name=None, image_id=None, flavor=None,
|
||||||
|
|
Loading…
Reference in New Issue