From bd5d48582c682f3802f4707578b3b06adf650ccf Mon Sep 17 00:00:00 2001 From: Alexandru Antone Date: Wed, 10 Jun 2020 21:09:32 +0300 Subject: [PATCH] Fix BMCException handling The outer control loop in install.py handled exceptions of type BMCException defined in remoteinstaller.installer.bmc_management.bmctools. Redefining BMCException for each platform in local scope caused it no to be properly handled and the running installation would not get its state change to failure, instead it would remain in 'ongoing' state indefinetly. If per-platform excception customization is required, then it should be done through inheritance from BMCException defined in bmctools. Signed-off-by: Alexandru Antone Change-Id: Ia6a09ee4b1a4b7e02113d75b02deec8ae7a19ae0 --- remote-installer.spec | 2 +- src/remoteinstaller/installer/bmc_management/falcon.py | 5 +---- src/remoteinstaller/installer/bmc_management/hw17.py | 5 +---- src/remoteinstaller/installer/bmc_management/oe19.py | 3 --- src/remoteinstaller/installer/bmc_management/or18.py | 5 +---- src/remoteinstaller/installer/bmc_management/rm18.py | 3 --- 6 files changed, 4 insertions(+), 19 deletions(-) diff --git a/remote-installer.spec b/remote-installer.spec index e23b04c..bbbbcb4 100644 --- a/remote-installer.spec +++ b/remote-installer.spec @@ -14,7 +14,7 @@ Name: remote-installer Version: %{_version} -Release: 5%{?dist} +Release: 6%{?dist} Summary: Contains components for the remote-installer Group: %{_platform_group} License: %{_platform_licence} diff --git a/src/remoteinstaller/installer/bmc_management/falcon.py b/src/remoteinstaller/installer/bmc_management/falcon.py index 34b3e42..ae67d5c 100644 --- a/src/remoteinstaller/installer/bmc_management/falcon.py +++ b/src/remoteinstaller/installer/bmc_management/falcon.py @@ -15,7 +15,7 @@ import logging import time -from .bmctools import BMC +from .bmctools import BMC, BMCException RAW_CHECK_NFS_SERVICE_STATUS = '0x32 0xd8 0x06 0x01 0x01 0x00' @@ -45,9 +45,6 @@ RAW_GET_MOUNTED_IMG_COUNT = '0x32 0xd8 0x00 0x01' RAW_SET_IMG_NAME = '0x32 0xd7 0x01 0x01 0x01 0x01 %s' RAW_STOP_REDIRECT = '0x32 0xd7 0x01 0x01 0x01 0x00 %s' -class BMCException(Exception): - pass - class FALCON(BMC): def __init__(self, host, user, passwd, priv_level='ADMINISTRATOR', log_path=None): super(FALCON, self).__init__(host, user, passwd, priv_level, log_path) diff --git a/src/remoteinstaller/installer/bmc_management/hw17.py b/src/remoteinstaller/installer/bmc_management/hw17.py index 869a6a2..42229fb 100644 --- a/src/remoteinstaller/installer/bmc_management/hw17.py +++ b/src/remoteinstaller/installer/bmc_management/hw17.py @@ -12,13 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .bmctools import BMC +from .bmctools import BMC, BMCException import logging import time -class BMCException(Exception): - pass - class HW17(BMC): def __init__(self, host, user, passwd, priv_level='ADMINISTRATOR', log_path=None): super(HW17, self).__init__(host, user, passwd, priv_level, log_path) diff --git a/src/remoteinstaller/installer/bmc_management/oe19.py b/src/remoteinstaller/installer/bmc_management/oe19.py index 958801c..dc44d99 100644 --- a/src/remoteinstaller/installer/bmc_management/oe19.py +++ b/src/remoteinstaller/installer/bmc_management/oe19.py @@ -15,9 +15,6 @@ from .or18 import OR18 import logging -class BMCException(Exception): - pass - class OE19(OR18): def __init__(self, host, user, passwd, priv_level='ADMINISTRATOR', log_path=None): super(OE19, self).__init__(host, user, passwd, priv_level, log_path) diff --git a/src/remoteinstaller/installer/bmc_management/or18.py b/src/remoteinstaller/installer/bmc_management/or18.py index 78606db..f2bf0ba 100644 --- a/src/remoteinstaller/installer/bmc_management/or18.py +++ b/src/remoteinstaller/installer/bmc_management/or18.py @@ -14,10 +14,7 @@ import logging import time -from .bmctools import BMC - -class BMCException(Exception): - pass +from .bmctools import BMC, BMCException class OR18(BMC): def __init__(self, host, user, passwd, priv_level='ADMINISTRATOR', log_path=None): diff --git a/src/remoteinstaller/installer/bmc_management/rm18.py b/src/remoteinstaller/installer/bmc_management/rm18.py index 7ca7881..1c72229 100644 --- a/src/remoteinstaller/installer/bmc_management/rm18.py +++ b/src/remoteinstaller/installer/bmc_management/rm18.py @@ -15,9 +15,6 @@ from .or18 import OR18 import logging -class BMCException(Exception): - pass - class RM18(OR18): def __init__(self, host, user, passwd, priv_level='ADMINISTRATOR', log_path=None): super(RM18, self).__init__(host, user, passwd, priv_level, log_path) -- 2.16.6