Skip to content

Commit 827c11c

Browse files
committed
Update clp_envvar_handler.py
1 parent 946fda3 commit 827c11c

1 file changed

Lines changed: 8 additions & 12 deletions

File tree

package/cloudshell/iac/terraform/services/clp_envvar_handler.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)