X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=n2vc%2Fk8s_juju_conn.py;h=d9dc6073000f1029a98d7044c8d7fa30961622ad;hp=f8ed0e0155cca930d744fdb677e943f0c0011fe7;hb=ed0ff05f09f276c753e5aa5439a3a1252b6a07e4;hpb=582b923b8f3f7104411c39ebdba63949d606ecd1 diff --git a/n2vc/k8s_juju_conn.py b/n2vc/k8s_juju_conn.py index f8ed0e0..d9dc607 100644 --- a/n2vc/k8s_juju_conn.py +++ b/n2vc/k8s_juju_conn.py @@ -129,7 +129,7 @@ class K8sJujuConnector(K8sConnector): cleanup_data.append( { "delete": kubectl.delete_cluster_role, - "args": (metadata_name), + "args": (metadata_name,), } ) @@ -140,7 +140,7 @@ class K8sJujuConnector(K8sConnector): cleanup_data.append( { "delete": kubectl.delete_service_account, - "args": (metadata_name), + "args": (metadata_name,), } ) @@ -151,7 +151,7 @@ class K8sJujuConnector(K8sConnector): cleanup_data.append( { "delete": kubectl.delete_service_account, - "args": (metadata_name), + "args": (metadata_name,), } ) token, client_cert_data = await kubectl.get_secret_data( @@ -303,6 +303,10 @@ class K8sJujuConnector(K8sConnector): raise K8sException("bundle must be set") if bundle.startswith("cs:"): + # For Juju Bundles provided by the Charm Store + pass + elif bundle.startswith("ch:"): + # For Juju Bundles provided by the Charm Hub (this only works for juju version >= 2.9) pass elif bundle.startswith("http"): # Download the file @@ -360,8 +364,8 @@ class K8sJujuConnector(K8sConnector): """Scale an application in a model :param: kdu_instance str: KDU instance name - :param: scale int: Scale to which to set this application - :param: resource_name str: Resource name (Application name) + :param: scale int: Scale to which to set the application + :param: resource_name str: The application name in the Juju Bundle :param: timeout float: The time, in seconds, to wait for the install to finish :param kwargs: Additional parameters @@ -394,12 +398,13 @@ class K8sJujuConnector(K8sConnector): ) -> int: """Get an application scale count - :param: resource_name str: Resource name (Application name) + :param: resource_name str: The application name in the Juju Bundle :param: kdu_instance str: KDU instance name :param kwargs: Additional parameters vca_id (str): VCA ID :return: Return application instance count """ + try: libjuju = await self._get_libjuju(kwargs.get("vca_id")) status = await libjuju.get_model_status(kdu_instance)