Move create key call into try/except in Digital Ocean key test

This commit is contained in:
Ch3LL 2019-06-21 14:47:56 -04:00
parent c6069520f1
commit 128ba07f95
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73

View file

@ -102,15 +102,15 @@ class DigitalOceanTest(ShellCase):
pub = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V example'
finger_print = '3b:16:bf:e4:8b:00:8b:b8:59:8c:a9:d3:f0:19:45:fa'
_key = self.run_cloud('-f create_key {0} name="MyPubKey" public_key="{1}"'.format(PROVIDER_NAME, pub))
# Upload public key
self.assertIn(
finger_print,
[i.strip() for i in _key]
)
try:
_key = self.run_cloud('-f create_key {0} name="MyPubKey" public_key="{1}"'.format(PROVIDER_NAME, pub))
# Upload public key
self.assertIn(
finger_print,
[i.strip() for i in _key]
)
# List all keys
list_keypairs = self.run_cloud('-f list_keypairs {0}'.format(PROVIDER_NAME))