From 143075b979246e1055feb0b455274c80c465ca54 Mon Sep 17 00:00:00 2001 From: Cristian Matiut Date: Tue, 24 Sep 2024 15:51:35 +0300 Subject: [PATCH] osmorphing: Fix undefined attribute installed_packages --- coriolis/osmorphing/base.py | 3 +-- coriolis/osmorphing/coreos.py | 2 +- coriolis/osmorphing/debian.py | 2 +- coriolis/osmorphing/openwrt.py | 2 +- coriolis/osmorphing/redhat.py | 1 + coriolis/osmorphing/suse.py | 1 + coriolis/osmorphing/windows.py | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/coriolis/osmorphing/base.py b/coriolis/osmorphing/base.py index fa1ecb1c..7d412904 100644 --- a/coriolis/osmorphing/base.py +++ b/coriolis/osmorphing/base.py @@ -79,7 +79,7 @@ def check_os_supported(cls, detected_os_info): cls.__name__)) @abc.abstractmethod - def get_installed_packages(self, package_name): + def get_installed_packages(self): pass @abc.abstractmethod @@ -125,7 +125,6 @@ def set_environment(self, environment): class BaseLinuxOSMorphingTools(BaseOSMorphingTools): _packages = {} - installed_packages = [] def __init__(self, conn, os_root_dir, os_root_dev, hypervisor, event_manager, detected_os_info, osmorphing_parameters, diff --git a/coriolis/osmorphing/coreos.py b/coriolis/osmorphing/coreos.py index 30c9d056..4c9d88db 100644 --- a/coriolis/osmorphing/coreos.py +++ b/coriolis/osmorphing/coreos.py @@ -15,7 +15,7 @@ def check_os_supported(cls, detected_os_info): return False def get_installed_package(self): - pass + self.installed_packages = [] def disable_predictable_nic_names(self): pass diff --git a/coriolis/osmorphing/debian.py b/coriolis/osmorphing/debian.py index a376ab4d..9372a512 100644 --- a/coriolis/osmorphing/debian.py +++ b/coriolis/osmorphing/debian.py @@ -128,7 +128,7 @@ def get_installed_packages(self): self.installed_packages = self._exec_cmd_chroot( cmd).decode('utf-8').splitlines() except exception.CoriolisException: - pass + self.installed_packages = [] def pre_packages_install(self, package_names): super(BaseDebianMorphingTools, self).pre_packages_install( diff --git a/coriolis/osmorphing/openwrt.py b/coriolis/osmorphing/openwrt.py index c0b9afae..a098c9cd 100644 --- a/coriolis/osmorphing/openwrt.py +++ b/coriolis/osmorphing/openwrt.py @@ -18,7 +18,7 @@ def check_os_supported(cls, detected_os_info): return False def get_installed_package(self): - pass + self.installed_packages = [] def disable_predictable_nic_names(self): pass diff --git a/coriolis/osmorphing/redhat.py b/coriolis/osmorphing/redhat.py index 1abf523f..aa784404 100644 --- a/coriolis/osmorphing/redhat.py +++ b/coriolis/osmorphing/redhat.py @@ -217,6 +217,7 @@ def get_installed_packages(self): except exception.CoriolisException: LOG.warning("Failed to get installed packages") LOG.trace(utils.get_exception_details()) + self.installed_packages = [] def _yum_install(self, package_names, enable_repos=[]): try: diff --git a/coriolis/osmorphing/suse.py b/coriolis/osmorphing/suse.py index 7da4f06d..5610a0b5 100644 --- a/coriolis/osmorphing/suse.py +++ b/coriolis/osmorphing/suse.py @@ -73,6 +73,7 @@ def get_installed_packages(self): except exception.CoriolisException: LOG.warning("Failed to get installed packages") LOG.trace(utils.get_exception_details()) + self.installed_packages = [] def get_update_grub2_command(self): location = self._get_grub2_cfg_location() diff --git a/coriolis/osmorphing/windows.py b/coriolis/osmorphing/windows.py index 8c8f707b..bc7bbac1 100644 --- a/coriolis/osmorphing/windows.py +++ b/coriolis/osmorphing/windows.py @@ -611,7 +611,7 @@ def get_packages(self): return [], [] def get_installed_packages(self): - pass + self.installed_packages = [] def pre_packages_install(self, package_names): pass