Skip to content

Commit 6fe43a9

Browse files
committed
fixed empty token issue for public repos
fixed 2G shells support for 2G CLPs
1 parent 6e11fbb commit 6fe43a9

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

package/cloudshell/iac/terraform/downloaders/github_downloader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, logger: Logger):
2525

2626
@retry((HTTPError, URLError), delay=1, backoff=2, tries=5)
2727
def download_repo(self, url: str, token: str, branch: str = "") -> str:
28-
headers = {'Authorization': f'token {token}'}
28+
headers = {'Authorization': f'token {token}'} if token else None
2929
self._validate_github_url(url)
3030
url_data = self._extract_data_from_url(url, branch)
3131
try:

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
from abc import ABCMeta
3-
43
from cloudshell.iac.terraform.models.shell_helper import ShellHelperObject
54

65

@@ -13,14 +12,14 @@ def set_env_vars_based_on_clp(self):
1312

1413
@staticmethod
1514
def does_attribute_match(clp_res_model, clp_attribute, attr_name_to_check) -> bool:
16-
if f"{clp_res_model}.{clp_attribute.Name}" == attr_name_to_check or clp_attribute.Name == attr_name_to_check:
15+
if f"{clp_res_model}.{clp_attribute.Name}" == attr_name_to_check or clp_attribute.Name == attr_name_to_check \
16+
or clp_attribute.Name == f"{clp_res_model}.{attr_name_to_check}":
1717
return True
1818
return False
1919

2020

2121
class AWSCloudProviderEnvVarHandler(BaseCloudProviderEnvVarHandler):
22-
def __init__(self, clp_res_model: str, clp_resource_attributes: list,
23-
shell_helper: ShellHelperObject):
22+
def __init__(self, clp_res_model: str, clp_resource_attributes: list, shell_helper: ShellHelperObject):
2423
BaseCloudProviderEnvVarHandler.__init__(self)
2524
self._clp_res_model = clp_res_model
2625
self._clp_resource_attributes = clp_resource_attributes
@@ -49,7 +48,7 @@ def set_env_vars_based_on_clp(self):
4948

5049

5150
class AzureCloudProviderEnvVarHandler(BaseCloudProviderEnvVarHandler):
52-
def __init__(self, clp_res_model, clp_resource_attributes, shell_helper):
51+
def __init__(self, clp_res_model: str, clp_resource_attributes: list, shell_helper: ShellHelperObject):
5352
BaseCloudProviderEnvVarHandler.__init__(self)
5453
self._clp_res_model = clp_res_model
5554
self._clp_resource_attributes = clp_resource_attributes
@@ -68,7 +67,7 @@ def set_env_vars_based_on_clp(self):
6867

6968

7069
class GCPCloudProviderEnvVarHandler(BaseCloudProviderEnvVarHandler):
71-
def __init__(self, clp_res_model, clp_resource_attributes, shell_helper):
70+
def __init__(self, clp_res_model: str, clp_resource_attributes: list, shell_helper: ShellHelperObject):
7271
BaseCloudProviderEnvVarHandler.__init__(self)
7372
self._clp_res_model = clp_res_model
7473
self._clp_resource_attributes = clp_resource_attributes

package/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.1
1+
1.2.2

0 commit comments

Comments
 (0)