From 0ef7e3be18d8f91d31ccb8237ec844f86ca17769 Mon Sep 17 00:00:00 2001 From: Kebo Liu Date: Thu, 16 May 2019 07:22:56 +0800 Subject: [PATCH] [sonic-cfggen] fix name conflict between sonic_platform package and sonic_platform.py (#2875) * fix name conflict between sonic_platfrom package and sonic_platform.py * update sonic-utility submodule to pickup lastest fix * Revert "update sonic-utility submodule to pickup lastest fix" This reverts commit f66aa99738e06373bc2e141f420eab71839ff4e8. * update sonic-utility sub module --- src/sonic-config-engine/setup.py | 2 +- src/sonic-config-engine/sonic-cfggen | 6 +++--- .../{sonic_platform.py => sonic_device_util.py} | 10 +++++++--- src/sonic-utilities | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) rename src/sonic-config-engine/{sonic_platform.py => sonic_device_util.py} (90%) diff --git a/src/sonic-config-engine/setup.py b/src/sonic-config-engine/setup.py index 8375b6af89..7ca810ce6a 100755 --- a/src/sonic-config-engine/setup.py +++ b/src/sonic-config-engine/setup.py @@ -16,7 +16,7 @@ setup(name='sonic-config-engine', author='Taoyu Li', author_email='taoyl@microsoft.com', url='https://github.com/Azure/sonic-buildimage', - py_modules=['portconfig', 'minigraph', 'openconfig_acl', 'sonic_platform', 'config_samples'], + py_modules=['portconfig', 'minigraph', 'openconfig_acl', 'sonic_device_util', 'config_samples'], scripts=['sonic-cfggen'], install_requires=['lxml', 'jinja2>=2.10', 'netaddr', 'ipaddr', 'pyyaml', 'pyangbind==0.6.0'], test_suite='setup.get_test_suite', diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index f923cc4bc6..e1fbd50825 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -28,9 +28,9 @@ from minigraph import minigraph_encoder from minigraph import parse_xml from minigraph import parse_device_desc_xml from portconfig import get_port_config -from sonic_platform import get_machine_info -from sonic_platform import get_platform_info -from sonic_platform import get_system_mac +from sonic_device_util import get_machine_info +from sonic_device_util import get_platform_info +from sonic_device_util import get_system_mac from config_samples import generate_sample_config from config_samples import get_available_config from swsssdk import ConfigDBConnector diff --git a/src/sonic-config-engine/sonic_platform.py b/src/sonic-config-engine/sonic_device_util.py similarity index 90% rename from src/sonic-config-engine/sonic_platform.py rename to src/sonic-config-engine/sonic_device_util.py index 20890d765c..16026a60af 100644 --- a/src/sonic-config-engine/sonic_platform.py +++ b/src/sonic-config-engine/sonic_device_util.py @@ -5,13 +5,17 @@ import subprocess DOCUMENTATION = ''' --- -module: sonic_platform +module: sonic_device_util version_added: "1.9" -short_description: Retrive platform related facts for a device. +short_description: Retrieve device related facts for a device. description: - - Retrieve platform related facts from config files. + - Retrieve device related facts from config files. ''' +''' +TODO: this file shall be renamed and moved to other places in future +to have it shared with multiple applications. +''' def get_machine_info(): if not os.path.isfile('/host/machine.conf'): return None diff --git a/src/sonic-utilities b/src/sonic-utilities index b86abe08fb..d12734e74c 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit b86abe08fb3ef87be471d101a771ee52705d8838 +Subproject commit d12734e74c64e9540483700230d04ba41a39af9f