From ac0595ecf939397665b00e0925d7ea44ab8d5663 Mon Sep 17 00:00:00 2001 From: Debayan Ray Date: Thu, 20 Jul 2017 17:05:24 -0400 Subject: [PATCH] Remove sushy manager hack Earlier we had included a temporary hack [0] for manager to pass in 'manager_mock.py' file till the point a new Sushy version is released with manager feature. This is to remove that temporary hack as Sushy had been released recently. Also pegged the version of Sushy to >=1.0.0 in requirements. [0] https://review.openstack.org/#/c/473719/ Change-Id: I8eb2389730bb5d65338d2562fe2a9462bafc3479 --- proliantutils/tests/__init__.py | 17 --------- proliantutils/tests/redfish/manager_mock.py | 39 --------------------- requirements.txt | 2 +- 3 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 proliantutils/tests/redfish/manager_mock.py diff --git a/proliantutils/tests/__init__.py b/proliantutils/tests/__init__.py index c83fcab..e69de29 100644 --- a/proliantutils/tests/__init__.py +++ b/proliantutils/tests/__init__.py @@ -1,17 +0,0 @@ -# Copyright 2017 Hewlett Packard Enterprise Development LP -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# TODO(deray): Need to remove this hack sooner -from proliantutils.tests.redfish import manager_mock # noqa diff --git a/proliantutils/tests/redfish/manager_mock.py b/proliantutils/tests/redfish/manager_mock.py deleted file mode 100644 index e884a33..0000000 --- a/proliantutils/tests/redfish/manager_mock.py +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2017 Hewlett Packard Enterprise Development LP -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# TODO(deray): Need to remove this hack sooner - -import sys - -import mock -from oslo_utils import importutils -import six - - -SUSHY_MANAGER_PACKAGE_SPEC = ('manager',) - -sushy = importutils.try_import('sushy') -if sushy: - sushy_resources_manager = mock.MagicMock( - spec_set=SUSHY_MANAGER_PACKAGE_SPEC) - sys.modules['sushy.resources.manager'] = sushy_resources_manager - sushy.resources.common = mock.MagicMock() - sushy_resources_manager.manager.Manager = type( - 'Manager', (sushy.resources.base.ResourceBase,), {}) - sushy.resources.common.ResetActionField = type( - 'ResetActionField', (sushy.resources.base.CompositeField,), - {"target_uri": sushy.resources.base.Field('target', required=True)}) - if 'proliantutils.redfish' in sys.modules: - six.moves.reload_module(sys.modules['proliantutils.redfish']) diff --git a/requirements.txt b/requirements.txt index 1ce9752..82fc5a6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,4 @@ retrying!=1.3.0,>=1.2.3 # Apache-2.0 pysnmp>=4.2.3,<5.0.0 # BSD # Redfish communication uses the Sushy library -sushy +sushy>=1.0.0