Add missing attribute in EthernetSwitch in RSD 2.2

Change-Id: Ia2f3c908bcf83c1d6b12230764fdd79d253ec541
This commit is contained in:
Lin Yang 2019-05-24 14:15:19 -07:00
parent f96b095e35
commit 7047651bed

View File

@ -13,16 +13,15 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from rsd_lib.resources.v2_1.ethernet_switch import ethernet_switch \
as v2_1_ethernet_switch
from rsd_lib.resources.v2_2.ethernet_switch import ethernet_switch_metrics
from rsd_lib.resources.v2_2.ethernet_switch import ethernet_switch_port
from sushy.resources import base from sushy.resources import base
from sushy import utils from sushy import utils
from rsd_lib.resources.v2_1.ethernet_switch import ethernet_switch
from rsd_lib.resources.v2_2.ethernet_switch import ethernet_switch_metrics
from rsd_lib.resources.v2_2.ethernet_switch import ethernet_switch_port
class EthernetSwitch(v2_1_ethernet_switch.EthernetSwitch):
class EthernetSwitch(ethernet_switch.EthernetSwitch):
@property @property
@utils.cache_it @utils.cache_it
def ports(self): def ports(self):
@ -37,10 +36,6 @@ class EthernetSwitch(v2_1_ethernet_switch.EthernetSwitch):
redfish_version=self.redfish_version, redfish_version=self.redfish_version,
) )
def _get_metrics_path(self):
"""Helper function to find the Metrics path"""
return utils.get_sub_resource_path_by(self, "Metrics")
@property @property
@utils.cache_it @utils.cache_it
def metrics(self): def metrics(self):
@ -51,7 +46,7 @@ class EthernetSwitch(v2_1_ethernet_switch.EthernetSwitch):
""" """
return ethernet_switch_metrics.EthernetSwitchMetrics( return ethernet_switch_metrics.EthernetSwitchMetrics(
self._conn, self._conn,
self._get_metrics_path(), utils.get_sub_resource_path_by(self, "Metrics"),
redfish_version=self.redfish_version, redfish_version=self.redfish_version,
) )