@@ -57,15 +57,11 @@ def __init__(self, clp_res_model, clp_resource_attributes, shell_helper):
5757
5858 def set_env_vars_based_on_clp (self ):
5959 for attr in self ._clp_resource_attributes :
60- attr_val = self .does_attribute_match (self ._clp_res_model , attr , self ._shell_helper , "Azure Subscription ID" )
61- if attr_val :
62- os .environ ["ARM_SUBSCRIPTION_ID" ] = attr_val
63- attr_val = self .does_attribute_match (self ._clp_res_model , attr , self ._shell_helper , "Azure Tenant ID" )
64- if attr_val :
65- os .environ ["Azure Tenant ID" ] = attr_val
66- attr_val = self .does_attribute_match (self ._clp_res_model , attr , self ._shell_helper , "Azure Application ID" )
67- if attr_val :
68- os .environ ["ARM_CLIENT_ID" ] = attr_val
69- attr_val = self .does_attribute_match (self ._clp_res_model , attr , self ._shell_helper , "Azure Application Key" , True )
70- if attr_val :
71- os .environ ["ARM_CLIENT_SECRET" ] = attr_val
60+ if self .does_attribute_match (self ._clp_res_model , attr , self ._shell_helper , "Azure Subscription ID" ):
61+ os .environ ["ARM_SUBSCRIPTION_ID" ] = attr .Value
62+ if self .does_attribute_match (self ._clp_res_model , attr , self ._shell_helper , "Azure Tenant ID" ):
63+ os .environ ["Azure Tenant ID" ] = attr .Value
64+ if self .does_attribute_match (self ._clp_res_model , attr , self ._shell_helper , "Azure Application ID" ):
65+ os .environ ["ARM_CLIENT_ID" ] = attr .Value
66+ if self .does_attribute_match (self ._clp_res_model , attr , self ._shell_helper , "Azure Application Key" , True ):
67+ os .environ ["ARM_CLIENT_SECRET" ] = self ._shell_helper .api .DecryptPassword (attr .Value ).Value
0 commit comments