Merge pull request #603 from jangsutsr/fix-7737-1

Follow up fix #542
This commit is contained in:
Aaron Tan 2017-12-01 16:07:14 -05:00 committed by GitHub
commit 1ff0591553
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -1080,6 +1080,8 @@ class RunJob(BaseTask):
env['AZURE_SUBSCRIPTION_ID'] = cloud_cred.subscription
env['AZURE_AD_USER'] = cloud_cred.username
env['AZURE_PASSWORD'] = decrypt_field(cloud_cred, 'password')
if cloud_cred.inputs.get('cloud_environment', None):
env['AZURE_CLOUD_ENVIRONMENT'] = cloud_cred.inputs['cloud_environment']
elif cloud_cred and cloud_cred.kind == 'vmware':
env['VMWARE_USER'] = cloud_cred.username
env['VMWARE_PASSWORD'] = decrypt_field(cloud_cred, 'password')

View File

@ -635,7 +635,8 @@ class TestJobCredentials(TestJobExecution):
inputs = {
'subscription': 'some-subscription',
'username': 'bob',
'password': 'secret'
'password': 'secret',
'cloud_environment': 'foobar'
}
)
credential.inputs['password'] = encrypt_field(credential, 'password')
@ -650,6 +651,7 @@ class TestJobCredentials(TestJobExecution):
assert env['AZURE_SUBSCRIPTION_ID'] == 'some-subscription'
assert env['AZURE_AD_USER'] == 'bob'
assert env['AZURE_PASSWORD'] == 'secret'
assert env['AZURE_CLOUD_ENVIRONMENT'] == 'foobar'
def test_vmware_credentials(self):
vmware = CredentialType.defaults['vmware']()