File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
33metadata :
44 template_name : Admin Ansible Config 2G
55 template_author : Quali
6- template_version : 1.0.2
6+ template_version : 1.0.3
77 template_icon : shell-icon.png
88
99description : >
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def is_base_path_gitlab_api(url):
1313 ex input - http://192.168.85.62/api/v4/projects/4/repository/files/hello_world.sh/raw?ref=master
1414 :param str url: the user input url
1515 """
16- base_path_pattern = "api/v\d/projects/\d/repository/files"
16+ base_path_pattern = "api/v\d/projects/\d+ /repository/files"
1717 matching = re .search (base_path_pattern , url )
1818 if not matching :
1919 return False
@@ -32,7 +32,7 @@ def validate_full_path_gitlab_url(url):
3232 raise Exception ("Gitlab Base Path validation failed. Should be of form '{}'" .format (BASE_PATH_SAMPLE ))
3333
3434 # VALIDATE ENTIRE GITLAB URL STRING
35- gitlab_api_pattern = "https?://.+/api/v\d/projects/\d/repository/files/.+/raw\?ref=.+"
35+ gitlab_api_pattern = "https?://.+/api/v\d+ /projects/\d/repository/files/.+/raw\?ref=.+"
3636 matching = re .match (gitlab_api_pattern , url )
3737 if not matching :
3838 sample_url = "http://<SERVER_IP>/api/4/projects/<PROJECT_ID>/repository/files/<PROJECT_PATH>/raw?ref=<GIT_BRANCH>"
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
33metadata :
44 template_name : Ansible Config 2G
55 template_author : Quali
6- template_version : 1.0.2
6+ template_version : 1.0.3
77 template_icon : shell-icon.png
88
99description : >
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def is_base_path_gitlab_api(url):
1313 ex input - http://192.168.85.62/api/v4/projects/4/repository/files/hello_world.sh/raw?ref=master
1414 :param str url: the user input url
1515 """
16- base_path_pattern = "api/v\d/projects/\d/repository/files"
16+ base_path_pattern = "api/v\d/projects/\d+ /repository/files"
1717 matching = re .search (base_path_pattern , url )
1818 if not matching :
1919 return False
@@ -32,7 +32,7 @@ def validate_full_path_gitlab_url(url):
3232 raise Exception ("Gitlab Base Path validation failed. Should be of form '{}'" .format (BASE_PATH_SAMPLE ))
3333
3434 # VALIDATE ENTIRE GITLAB URL STRING
35- gitlab_api_pattern = "https?://.+/api/v\d/projects/\d/repository/files/.+/raw\?ref=.+"
35+ gitlab_api_pattern = "https?://.+/api/v\d/projects/\d+ /repository/files/.+/raw\?ref=.+"
3636 matching = re .match (gitlab_api_pattern , url )
3737 if not matching :
3838 sample_url = "http://<SERVER_IP>/api/4/projects/<PROJECT_ID>/repository/files/<PROJECT_PATH>/raw?ref=<GIT_BRANCH>"
You can’t perform that action at this time.
0 commit comments