Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug fix]Fix "sonic_platform" name conflict #528

Merged
merged 5 commits into from
May 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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