diff --git a/rsd_lib/resources/v2_2/ethernet_switch/ethernet_switch.py b/rsd_lib/resources/v2_2/ethernet_switch/ethernet_switch.py index 7985e6f..9fe0a28 100644 --- a/rsd_lib/resources/v2_2/ethernet_switch/ethernet_switch.py +++ b/rsd_lib/resources/v2_2/ethernet_switch/ethernet_switch.py @@ -13,16 +13,15 @@ # License for the specific language governing permissions and limitations # 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 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 @utils.cache_it def ports(self): @@ -37,21 +36,17 @@ class EthernetSwitch(v2_1_ethernet_switch.EthernetSwitch): 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 @utils.cache_it def metrics(self): """Property to provide reference to `EthernetSwitchMetrics` instance - It is calculated once when it is queried for the first time. On - refresh, this property is reset. + It is calculated once when it is queried for the first time. On + refresh, this property is reset. """ return ethernet_switch_metrics.EthernetSwitchMetrics( self._conn, - self._get_metrics_path(), + utils.get_sub_resource_path_by(self, "Metrics"), redfish_version=self.redfish_version, )