Merge pull request #52736 from dwoz/ec2test

Skip password decryption test when no libraries available
This commit is contained in:
Daniel Wozniak 2019-04-29 10:07:55 -07:00 committed by GitHub
commit 6bfca941a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -4887,6 +4887,8 @@ def get_password_data(
ret[next(six.iterkeys(item))] = next(six.itervalues(item))
if not HAS_M2 and not HAS_PYCRYPTO:
if 'key' in kwargs or 'key_file' in kwargs:
log.warn("No crypto library is installed, can not decrypt password")
return ret
if 'key' not in kwargs:

View file

@ -66,6 +66,7 @@ class EC2TestCase(TestCase, LoaderModuleMockMixin):
self.assertRaises(
SaltCloudSystemExit, ec2._validate_key_path_and_mode, 'key_file')
@skipIf(not ec2.HAS_M2 and not ec2.HAS_PYCRYPTO, 'Needs crypto library')
@patch('salt.cloud.clouds.ec2._get_node')
@patch('salt.cloud.clouds.ec2.get_location')
@patch('salt.cloud.clouds.ec2.get_provider')