Commit 92b6aff4 authored by harshavardhan.c's avatar harshavardhan.c

enh: code fixes.

parent bb37df04
...@@ -163,6 +163,7 @@ if __name__ == '__main__': ...@@ -163,6 +163,7 @@ if __name__ == '__main__':
os.makedirs(module_path) os.makedirs(module_path)
helm_out_file_path = os.path.join(OUTPUT_PATH, f'{_module}.yml') helm_out_file_path = os.path.join(OUTPUT_PATH, f'{_module}.yml')
if os.path.exists(helm_out_file_path): if os.path.exists(helm_out_file_path):
logging.debug(f"Helm Deployment File found for selected the module {_module}")
continue continue
variables_file_path = os.path.join(module_path, variables_file) variables_file_path = os.path.join(module_path, variables_file)
git_info = git_handler_obj.get_git_url_by_module_name(module_name=_module) git_info = git_handler_obj.get_git_url_by_module_name(module_name=_module)
...@@ -203,8 +204,8 @@ if __name__ == '__main__': ...@@ -203,8 +204,8 @@ if __name__ == '__main__':
helm_out_file_path=helm_out_file_path, helm_out_file_path=helm_out_file_path,
global_config_data=global_config_data, global_config_data=global_config_data,
module_name=_file.split(".yml")[0]) module_name=_file.split(".yml")[0])
push_helm_deployments(helm_repo, git_access_token, _client_name, final_helm_path=OUTPUT_PATH, # push_helm_deployments(helm_repo, git_access_token, _client_name, final_helm_path=OUTPUT_PATH,
base_path=helm_path) # base_path=helm_path)
except Exception as e: except Exception as e:
logging.exception(f"Exception Occurred while processing the Helm-Script Preparation {e.args}") logging.exception(f"Exception Occurred while processing the Helm-Script Preparation {e.args}")
......
...@@ -43,6 +43,9 @@ class GitHandler: ...@@ -43,6 +43,9 @@ class GitHandler:
with open(file_output_path, 'wb') as f: with open(file_output_path, 'wb') as f:
pl.files.raw(file_path=clone_file_path, ref=clone_branch, streamed=True, action=f.write) pl.files.raw(file_path=clone_file_path, ref=clone_branch, streamed=True, action=f.write)
return True return True
except gitlab.exceptions.GitlabGetError as e:
logging.debug(f"Variables.yml not found for selected the module {repo_link}")
return False
except Exception as e: except Exception as e:
logging.exception(f"Exception occurred while cloning the git repo - {repo_link} - {e.args}") logging.exception(f"Exception occurred while cloning the git repo - {repo_link} - {e.args}")
return False return False
......
...@@ -24,8 +24,8 @@ class HelmHandler: ...@@ -24,8 +24,8 @@ class HelmHandler:
existing_data.get('deployment', {}).get('environmentVar', [])} existing_data.get('deployment', {}).get('environmentVar', [])}
diff_keys = list(set(existing_env_variables.keys()).symmetric_difference(set(module_env_variables.keys()))) diff_keys = list(set(existing_env_variables.keys()).symmetric_difference(set(module_env_variables.keys())))
for _each in diff_keys: for _each in diff_keys:
if _each.lower() in {'port', 'service_port', 'module_port'} and module_env_variables[_each].get( if _each.lower() in {'port', 'service_port', 'module_port'} and module_env_variables.get(_each) and \
"value"): module_env_variables[_each].get("value"):
global_config_vars["SERVICE_PORT"] = module_env_variables[_each]["value"] global_config_vars["SERVICE_PORT"] = module_env_variables[_each]["value"]
continue continue
if module_env_variables.get(_each): if module_env_variables.get(_each):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment