From 09806b861486091d9db5cb75bdd2cc9428e46844 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Fri, 10 May 2019 03:06:57 +0800 Subject: [PATCH] fix name conflict between sonic_platform.py and package sonic_platform (#528) --- config/main.py | 4 ++-- scripts/decode-syseeprom | 4 ++-- scripts/neighbor_advertiser | 2 +- scripts/teamshow | 4 ++-- show/main.py | 12 ++++++------ show/mlnx.py | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/config/main.py b/config/main.py index 9461cb233de4..177b49bc3b19 100755 --- a/config/main.py +++ b/config/main.py @@ -9,7 +9,7 @@ import re import syslog -import sonic_platform +import sonic_device_util from swsssdk import ConfigDBConnector from swsssdk import SonicV2Connector from minigraph import parse_device_desc_xml @@ -1077,7 +1077,7 @@ def asymmetric(ctx, status): def platform(): """Platform-related configuration tasks""" -version_info = sonic_platform.get_sonic_version_info() +version_info = sonic_device_util.get_sonic_version_info() if (version_info and version_info.get('asic_type') == 'mellanox'): platform.add_command(mlnx.mlnx) diff --git a/scripts/decode-syseeprom b/scripts/decode-syseeprom index 8d1586861f3c..ffa50ce24f5e 100755 --- a/scripts/decode-syseeprom +++ b/scripts/decode-syseeprom @@ -17,8 +17,8 @@ try: import imp from sonic_eeprom import eeprom_dts import glob - from sonic_platform import get_machine_info - from sonic_platform import get_platform_info + from sonic_device_util import get_machine_info + from sonic_device_util import get_platform_info except ImportError, e: raise ImportError (str(e) + "- required module not found") diff --git a/scripts/neighbor_advertiser b/scripts/neighbor_advertiser index cd9dd645e2db..154b97699473 100644 --- a/scripts/neighbor_advertiser +++ b/scripts/neighbor_advertiser @@ -14,7 +14,7 @@ import requests import argparse import syslog import traceback -import sonic_platform +import sonic_device_util from swsssdk import ConfigDBConnector from swsssdk import SonicV2Connector diff --git a/scripts/teamshow b/scripts/teamshow index d824a948c448..fa203c8259da 100755 --- a/scripts/teamshow +++ b/scripts/teamshow @@ -27,8 +27,8 @@ import subprocess import sys from tabulate import tabulate from natsort import natsorted -from sonic_platform import get_machine_info -from sonic_platform import get_platform_info +from sonic_device_util import get_machine_info +from sonic_device_util import get_platform_info PORT_CHANNEL_APPL_TABLE_PREFIX = "LAG_TABLE:" PORT_CHANNEL_CFG_TABLE_PREFIX = "PORTCHANNEL|" diff --git a/show/main.py b/show/main.py index 1a078ad134bb..a11a20c7a2e3 100755 --- a/show/main.py +++ b/show/main.py @@ -14,7 +14,7 @@ from natsort import natsorted from tabulate import tabulate -import sonic_platform +import sonic_device_util from swsssdk import ConfigDBConnector from swsssdk import SonicV2Connector @@ -1103,8 +1103,8 @@ def get_hw_info_dict(): This function is used to get the HW info helper function """ hw_info_dict = {} - machine_info = sonic_platform.get_machine_info() - platform = sonic_platform.get_platform_info(machine_info) + machine_info = sonic_device_util.get_machine_info() + platform = sonic_device_util.get_platform_info(machine_info) config_db = ConfigDBConnector() config_db.connect() data = config_db.get_table('DEVICE_METADATA') @@ -1112,7 +1112,7 @@ def get_hw_info_dict(): hwsku = data['localhost']['hwsku'] except KeyError: hwsku = "Unknown" - version_info = sonic_platform.get_sonic_version_info() + version_info = sonic_device_util.get_sonic_version_info() asic_type = version_info['asic_type'] hw_info_dict['platform'] = platform hw_info_dict['hwsku'] = hwsku @@ -1124,7 +1124,7 @@ def platform(): """Show platform-specific hardware info""" pass -version_info = sonic_platform.get_sonic_version_info() +version_info = sonic_device_util.get_sonic_version_info() if (version_info and version_info.get('asic_type') == 'mellanox'): platform.add_command(mlnx.mlnx) @@ -1195,7 +1195,7 @@ def logging(process, lines, follow, verbose): @click.option("--verbose", is_flag=True, help="Enable verbose output") def version(verbose): """Show version information""" - version_info = sonic_platform.get_sonic_version_info() + version_info = sonic_device_util.get_sonic_version_info() hw_info_dict = get_hw_info_dict() serial_number_cmd = "sudo decode-syseeprom -s" serial_number = subprocess.Popen(serial_number_cmd, shell=True, stdout=subprocess.PIPE) diff --git a/show/mlnx.py b/show/mlnx.py index c38376670aa8..9ae19002eb55 100644 --- a/show/mlnx.py +++ b/show/mlnx.py @@ -9,7 +9,7 @@ import sys import subprocess import click - import sonic_platform + import sonic_device_util from swsssdk import ConfigDBConnector import xml.etree.ElementTree as ET except ImportError as e: