X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2Fvim_sdn.py;h=47015c0e2ead4839bbee1749b6c305f099bc8fd8;hb=refs%2Fchanges%2F67%2F13467%2F2;hp=ea25c2bdc4f5cdd2b39930d3c7eed6795c695647;hpb=4d209f039b05c39750dd192095cffba9e3a80925;p=osm%2FLCM.git diff --git a/osm_lcm/vim_sdn.py b/osm_lcm/vim_sdn.py index ea25c2b..47015c0 100644 --- a/osm_lcm/vim_sdn.py +++ b/osm_lcm/vim_sdn.py @@ -46,7 +46,7 @@ class VimLcm(LcmBase): ), } - def __init__(self, msg, lcm_tasks, config, loop): + def __init__(self, msg, lcm_tasks, config): """ Init, Connect to database, filesystem storage, and messaging :param config: two level dictionary with configuration. Top level should contain 'database', 'storage', @@ -54,7 +54,6 @@ class VimLcm(LcmBase): """ self.logger = logging.getLogger("lcm.vim") - self.loop = loop self.lcm_tasks = lcm_tasks self.ro_config = config["RO"] @@ -111,7 +110,7 @@ class VimLcm(LcmBase): db_vim_update["_admin.deployed.RO"] = None db_vim_update["_admin.detailed-status"] = step self.update_db_2("vim_accounts", vim_id, db_vim_update) - RO = ROclient.ROClient(self.loop, **self.ro_config) + RO = ROclient.ROClient(**self.ro_config) vim_RO = deepcopy(vim_content) vim_RO.pop("_id", None) vim_RO.pop("_admin", None) @@ -270,7 +269,7 @@ class VimLcm(LcmBase): RO_vim_id = db_vim["_admin"]["deployed"]["RO"] step = "Editing vim at RO" - RO = ROclient.ROClient(self.loop, **self.ro_config) + RO = ROclient.ROClient(**self.ro_config) vim_RO = deepcopy(vim_content) vim_RO.pop("_id", None) vim_RO.pop("_admin", None) @@ -394,7 +393,7 @@ class VimLcm(LcmBase): and db_vim["_admin"]["deployed"].get("RO") ): RO_vim_id = db_vim["_admin"]["deployed"]["RO"] - RO = ROclient.ROClient(self.loop, **self.ro_config) + RO = ROclient.ROClient(**self.ro_config) step = "Detaching vim from RO tenant" try: await RO.detach("vim_account", RO_vim_id) @@ -465,7 +464,7 @@ class WimLcm(LcmBase): # values that are encrypted at wim config because they are passwords wim_config_encrypted = () - def __init__(self, msg, lcm_tasks, config, loop): + def __init__(self, msg, lcm_tasks, config): """ Init, Connect to database, filesystem storage, and messaging :param config: two level dictionary with configuration. Top level should contain 'database', 'storage', @@ -473,7 +472,6 @@ class WimLcm(LcmBase): """ self.logger = logging.getLogger("lcm.vim") - self.loop = loop self.lcm_tasks = lcm_tasks self.ro_config = config["RO"] @@ -502,7 +500,7 @@ class WimLcm(LcmBase): step = "Creating wim at RO" db_wim_update["_admin.detailed-status"] = step self.update_db_2("wim_accounts", wim_id, db_wim_update) - RO = ROclient.ROClient(self.loop, **self.ro_config) + RO = ROclient.ROClient(**self.ro_config) wim_RO = deepcopy(wim_content) wim_RO.pop("_id", None) wim_RO.pop("_admin", None) @@ -625,7 +623,7 @@ class WimLcm(LcmBase): ): RO_wim_id = db_wim["_admin"]["deployed"]["RO"] step = "Editing wim at RO" - RO = ROclient.ROClient(self.loop, **self.ro_config) + RO = ROclient.ROClient(**self.ro_config) wim_RO = deepcopy(wim_content) wim_RO.pop("_id", None) wim_RO.pop("_admin", None) @@ -741,7 +739,7 @@ class WimLcm(LcmBase): and db_wim["_admin"]["deployed"].get("RO") ): RO_wim_id = db_wim["_admin"]["deployed"]["RO"] - RO = ROclient.ROClient(self.loop, **self.ro_config) + RO = ROclient.ROClient(**self.ro_config) step = "Detaching wim from RO tenant" try: await RO.detach("wim_account", RO_wim_id) @@ -809,7 +807,7 @@ class WimLcm(LcmBase): class SdnLcm(LcmBase): - def __init__(self, msg, lcm_tasks, config, loop): + def __init__(self, msg, lcm_tasks, config): """ Init, Connect to database, filesystem storage, and messaging :param config: two level dictionary with configuration. Top level should contain 'database', 'storage', @@ -817,7 +815,6 @@ class SdnLcm(LcmBase): """ self.logger = logging.getLogger("lcm.sdn") - self.loop = loop self.lcm_tasks = lcm_tasks self.ro_config = config["RO"] @@ -848,7 +845,7 @@ class SdnLcm(LcmBase): db_sdn_update["_admin.detailed-status"] = step self.update_db_2("sdns", sdn_id, db_sdn_update) - RO = ROclient.ROClient(self.loop, **self.ro_config) + RO = ROclient.ROClient(**self.ro_config) sdn_RO = deepcopy(sdn_content) sdn_RO.pop("_id", None) sdn_RO.pop("_admin", None) @@ -931,7 +928,7 @@ class SdnLcm(LcmBase): and db_sdn["_admin"]["deployed"].get("RO") ): RO_sdn_id = db_sdn["_admin"]["deployed"]["RO"] - RO = ROclient.ROClient(self.loop, **self.ro_config) + RO = ROclient.ROClient(**self.ro_config) step = "Editing sdn at RO" sdn_RO = deepcopy(sdn_content) sdn_RO.pop("_id", None) @@ -1011,7 +1008,7 @@ class SdnLcm(LcmBase): and db_sdn["_admin"]["deployed"].get("RO") ): RO_sdn_id = db_sdn["_admin"]["deployed"]["RO"] - RO = ROclient.ROClient(self.loop, **self.ro_config) + RO = ROclient.ROClient(**self.ro_config) step = "Deleting sdn from RO" try: await RO.delete("sdn", RO_sdn_id) @@ -1068,7 +1065,7 @@ class SdnLcm(LcmBase): class K8sClusterLcm(LcmBase): timeout_create = 300 - def __init__(self, msg, lcm_tasks, config, loop): + def __init__(self, msg, lcm_tasks, config): """ Init, Connect to database, filesystem storage, and messaging :param config: two level dictionary with configuration. Top level should contain 'database', 'storage', @@ -1076,7 +1073,6 @@ class K8sClusterLcm(LcmBase): """ self.logger = logging.getLogger("lcm.k8scluster") - self.loop = loop self.lcm_tasks = lcm_tasks self.vca_config = config["VCA"] @@ -1104,7 +1100,6 @@ class K8sClusterLcm(LcmBase): kubectl_command=self.vca_config.get("kubectlpath"), juju_command=self.vca_config.get("jujupath"), log=self.logger, - loop=self.loop, on_update_db=None, db=self.db, fs=self.fs, @@ -1366,7 +1361,7 @@ class K8sClusterLcm(LcmBase): db_k8scluster_update["_admin.helm-chart.operationalState"] = "DISABLED" if k8s_h3c_id: - step = "Removing helm-chart-v3 '{}'".format(k8s_hc_id) + step = "Removing helm-chart-v3 '{}'".format(k8s_h3c_id) uninstall_sw = ( deep_get(db_k8scluster, ("_admin", "helm-chart-v3", "created")) or False @@ -1451,7 +1446,7 @@ class K8sClusterLcm(LcmBase): class VcaLcm(LcmBase): timeout_create = 30 - def __init__(self, msg, lcm_tasks, config, loop): + def __init__(self, msg, lcm_tasks, config): """ Init, Connect to database, filesystem storage, and messaging :param config: two level dictionary with configuration. Top level should contain 'database', 'storage', @@ -1459,15 +1454,12 @@ class VcaLcm(LcmBase): """ self.logger = logging.getLogger("lcm.vca") - self.loop = loop self.lcm_tasks = lcm_tasks super().__init__(msg, self.logger) # create N2VC connector - self.n2vc = N2VCJujuConnector( - log=self.logger, loop=self.loop, fs=self.fs, db=self.db - ) + self.n2vc = N2VCJujuConnector(log=self.logger, fs=self.fs, db=self.db) def _get_vca_by_id(self, vca_id: str) -> dict: db_vca = self.db.get_one("vca", {"_id": vca_id}) @@ -1687,7 +1679,7 @@ class VcaLcm(LcmBase): class K8sRepoLcm(LcmBase): - def __init__(self, msg, lcm_tasks, config, loop): + def __init__(self, msg, lcm_tasks, config): """ Init, Connect to database, filesystem storage, and messaging :param config: two level dictionary with configuration. Top level should contain 'database', 'storage', @@ -1695,7 +1687,6 @@ class K8sRepoLcm(LcmBase): """ self.logger = logging.getLogger("lcm.k8srepo") - self.loop = loop self.lcm_tasks = lcm_tasks self.vca_config = config["VCA"]