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
This commit is contained in:
Debayan Ray 2017-07-20 17:05:24 -04:00
parent 108938591f
commit ac0595ecf9
3 changed files with 1 additions and 57 deletions

View File

@ -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

View File

@ -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'])

View File

@ -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