X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=xapp_onboarder%2Fxapp_onboarder%2Fhelm_controller%2FxApp_builder.py;h=0cd821b6d5a17dae2c48815117f8506ec75fb8d2;hb=cd4b9aaa9aa6f3f0bfef09c4808315f10a385310;hp=1018f4067c05dce5392a11a0347473aa92ddf806;hpb=873846987e07978e790f264341c58699c5c8dfb0;p=it%2Fdev.git diff --git a/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py b/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py index 1018f40..0cd821b 100644 --- a/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py +++ b/xapp_onboarder/xapp_onboarder/helm_controller/xApp_builder.py @@ -159,46 +159,11 @@ class xApp(): outputfile.write(indented_probe_definition_yaml) - def append_config_to_values_yaml(self): with open(self.chart_workspace_path + '/' + self.chart_name + '/values.yaml', 'a') as outputfile: yaml.dump(self.config_file, outputfile, default_flow_style=False) - def append_env_to_config_map(self): - with open(self.chart_workspace_path + '/' + self.chart_name + '/templates/appenv.yaml', 'a') as outputfile: - append = {} - if settings.DBAAS_MASTER_NAME: - master_name = settings.DBAAS_MASTER_NAME - service_host = settings.DBAAS_SERVICE_HOST - sentinel_port = settings.DBAAS_SERVICE_SENTINEL_PORT - if not service_host: - raise xAppError( - "Internal failure. Cannot find environment variable 'DBAAS_SERVICE_HOST'. (Caused by: Misconfiguration of temp deployment)", 500) - if not sentinel_port: - raise xAppError( - "Internal failure. Cannot find environment variable 'DBAAS_SERVICE_SENTINEL_PORT'. (Caused by: Misconfiguration of temp deployment)", 500) - - append['DBAAS_MASTER_NAME'] = master_name - append['DBAAS_SERVICE_HOST'] = service_host - append['DBAAS_SERVICE_SENTINEL_PORT'] = sentinel_port - elif settings.DBAAS_SERVICE_HOST: - service_host = settings.DBAAS_SERVICE_HOST - service_port = settings.DBAAS_SERVICE_PORT - if not service_port: - raise xAppError( - "Internal failure. Cannot find environment variable 'DBAAS_SERVICE_PORT'. (Caused by: Misconfiguration of temp deployment)", 500) - append['DBAAS_SERVICE_HOST'] = service_host - append['DBAAS_SERVICE_PORT'] = service_port - else: - raise xAppError( - "Internal failure. Cannot find environment variable 'DBAAS_SERVICE_HOST' or 'DBAAS_MASTER_NAME'. (Caused by: Misconfiguration of temp deployment)", - 500) - output_yaml = yaml.dump(append) - indented_output_yaml = indent(output_yaml, 2) - outputfile.write(indented_output_yaml) - - def change_chart_name_version(self): with open(self.chart_workspace_path + '/' + self.chart_name + '/Chart.yaml', 'r') as inputfile: self.chart_yaml = yaml.load(inputfile, Loader=yaml.FullLoader) @@ -225,7 +190,6 @@ class xApp(): def package_chart(self): self.append_config_to_config_map() self.append_config_to_values_yaml() - self.append_env_to_config_map() self.add_probes_to_deployment() self.change_chart_name_version() self.helm_lint()