X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=xapp_orchestrater%2Fdev%2Fxapp_onboarder%2Fxapp_onboarder%2Fserver%2Fcli.py;h=aa582672f3ccaa6e47b3a4856ce85c077e08f306;hb=refs%2Fchanges%2F51%2F12851%2F1;hp=03d0827e64ebfbc91d4c82290509bcf31137a6e2;hpb=e6ee210cc5a632c070c2cf7658f5479fd4e893dd;p=ric-plt%2Fappmgr.git diff --git a/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/server/cli.py b/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/server/cli.py index 03d0827..aa58267 100755 --- a/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/server/cli.py +++ b/xapp_orchestrater/dev/xapp_onboarder/xapp_onboarder/server/cli.py @@ -46,8 +46,8 @@ class cli(): content, status = download_chart_package(xapp_chart_name=xapp_chart_name, version=version) if status != 200: - return json.dumps(content, indent=4, sort_keys=True) - + #return json.dumps(content, indent=4, sort_keys=True) + return {"status": "NOT_OK"} try: if os.path.isabs(output_path): path = output_path + '/' + xapp_chart_name + '-' + version + '.tgz' @@ -95,15 +95,17 @@ class cli(): """Installing the xapp using the charts name and version,optionally can provide the yaml file to override""" resp = self.download_helm_chart(xapp_chart_name, version) + if resp['status'] == "NOT_OK": + return {"status": "Not OK"} status = xApp.install_chart_package(xapp_chart_name=xapp_chart_name, version=version, namespace=namespace,overridefile=overridefile) if status == 1: return {"status": "OK"} else: return {"status": "NOT_OK"} - def uninstall(self, xapp_chart_name ,namespace): - """Uninstalling the xapp using the charts name""" - status = xApp.uninstall_chart_package(xapp_chart_name=xapp_chart_name, namespace=namespace) + def uninstall(self, xapp_chart_name, namespace, version=""): + """Uninstalling the xapp using the charts name, --version can be provided optionally""" + status = xApp.uninstall_chart_package(xapp_chart_name=xapp_chart_name, namespace=namespace, version=version) if status == 1: return {"status": "OK"} else: @@ -112,13 +114,13 @@ class cli(): def upgrade(self, xapp_chart_name, old_version , new_version, namespace): """Upgrading the xapp to the new version specified""" - resp = self.uninstall(xapp_chart_name, namespace) + resp = self.uninstall(xapp_chart_name, namespace,old_version) if resp["status"] == "OK": status = self.install(xapp_chart_name, new_version, namespace) if status["status"] == "OK": return {"status": "OK"} else: - self.uninstall(xapp_chart_name, namespace) + self.uninstall(xapp_chart_name, namespace,new_version) self.install(xapp_chart_name, old_version, namespace) return {"status": "NOT_OK"} else: