Skip to content

Commit

Permalink
fix name conflict between sonic_platform.py and package sonic_platform (
Browse files Browse the repository at this point in the history
  • Loading branch information
keboliu authored and jleveque committed May 9, 2019
1 parent 125e3d9 commit 09806b8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions scripts/decode-syseeprom
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion scripts/neighbor_advertiser
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions scripts/teamshow
Original file line number Diff line number Diff line change
Expand Up @@ -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|"
Expand Down
12 changes: 6 additions & 6 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -1103,16 +1103,16 @@ 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')
try:
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
Expand All @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion show/mlnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 09806b8

Please sign in to comment.