From d35d59907237c377f0da3537024e2b30e8f55b25 Mon Sep 17 00:00:00 2001 From: Madhan Babu Date: Thu, 5 Nov 2020 20:42:10 +0200 Subject: [PATCH 1/8] updating submodule changes --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index b6af9f48e298..99de1678e25f 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit b6af9f48e29852985137a57ff5396591af7f107c +Subproject commit 99de1678e25fd8499dadb2044802a1b6ab388b50 From 2c9454e86af7311e9ebc81efb734782969550693 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 5 Nov 2020 11:17:08 -0800 Subject: [PATCH 2/8] [sonic-device-data] Convert Python files to Python 3 (#5816) - Convert config_checker, media_checker and platform_json_checker scripts to Python 3 - Reorganize imports per PEP8 standard - Two blank lines precede functions per PEP8 standard --- src/sonic-device-data/tests/config_checker | 20 ++++--- src/sonic-device-data/tests/media_checker | 52 ++++++++++-------- .../tests/platform_json_checker | 54 +++++++++---------- 3 files changed, 67 insertions(+), 59 deletions(-) diff --git a/src/sonic-device-data/tests/config_checker b/src/sonic-device-data/tests/config_checker index 6cb4d029be58..76fdde17d288 100755 --- a/src/sonic-device-data/tests/config_checker +++ b/src/sonic-device-data/tests/config_checker @@ -1,20 +1,23 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 + +import glob import re import sys -import glob permitted_properties = [] + def usage(): - print "Usage: " + sys.argv[0] + " " + print("Usage: " + sys.argv[0] + " ") sys.exit(1) -def check_property(p): +def check_property(p): if p in permitted_properties: return True return False + def check_file(file_name): try: file_ok = True @@ -58,14 +61,14 @@ def check_file(file_name): if not check_property(p): file_ok = False - print("[line %d] Error: %s is not permitted" % (lineno, p)) + print("[line {}] Error: {} is not permitted".format(lineno, p)) if file_ok: - print "Result: " + file_name + " PASSED the config check!" + print("Result: " + file_name + " PASSED the config check!") else: - print "Result: " + file_name + " FAILED the config check!" + print("Result: " + file_name + " FAILED the config check!") return file_ok except IOError: - print "Error: Cannot open file " + file_name + print("Error: Cannot open file " + file_name) return False @@ -93,5 +96,6 @@ def main(argv): if not all_good: sys.exit(-1) + if __name__ == "__main__": main(sys.argv[1:]) diff --git a/src/sonic-device-data/tests/media_checker b/src/sonic-device-data/tests/media_checker index 132756cb4b77..7d59d88254c5 100755 --- a/src/sonic-device-data/tests/media_checker +++ b/src/sonic-device-data/tests/media_checker @@ -1,8 +1,9 @@ -#!/usr/bin/env python -import re -import sys +#!/usr/bin/env python3 + import glob import json +import re +import sys level1_keys = ["GLOBAL_MEDIA_SETTINGS","PORT_MEDIA_SETTINGS"] setting_keys = ["preemphasis","idriver","ipredriver"] @@ -10,6 +11,7 @@ lane_prefix = "lane" comma_separator = "," range_separator = "-" + def check_lane_and_value(lane_name, lane_value): if lane_prefix in lane_name: try: @@ -18,30 +20,32 @@ def check_lane_and_value(lane_name, lane_value): return True except ValueError: - print "Invalid lane values " + lane_name + " " + lane_value + print("Invalid lane values " + lane_name + " " + lane_value) return False else: return False + def usage(): - print "Usage: " + sys.argv[0] + " " + print("Usage: " + sys.argv[0] + " ") sys.exit(1) + def check_media_dict(vendor_dict): if len(vendor_dict) == 0: - print "Expecting values for media type " + keys + print("Expecting values for media type " + keys) return False for vendor_key in vendor_dict: value_dict = vendor_dict[vendor_key] if len(value_dict) == 0: - print "Expecting settings for vendor type " + vendor_key + print("Expecting settings for vendor type " + vendor_key) return False for value_key in value_dict: if value_key not in setting_keys: - print "Unknown media setting " + value_key + print("Unknown media setting " + value_key) return False lane_dict = value_dict[value_key] @@ -50,6 +54,7 @@ def check_media_dict(vendor_dict): return False return True + def check_valid_port(port_name): try: val = int(port_name.strip()) @@ -57,17 +62,19 @@ def check_valid_port(port_name): except ValueError: return False + def check_port_keys(port_media_dict): for port in port_media_dict: if not check_valid_port(port): - print "Invalid port name " + port + print("Invalid port name " + port) return False if not check_media_dict(port_media_dict[port]): return False return True + def check_global_keys(global_media_dict): for keys in global_media_dict: if comma_separator in keys: @@ -77,22 +84,22 @@ def check_global_keys(global_media_dict): range_list = port.split(range_separator) for port_val in range_list: if not check_valid_port(port_val): - print "Error: Unrecognized port number " + port_val - print "Invalid range " + port + print("Error: Unrecognized port number " + port_val) + print("Invalid range " + port) return False else: if not check_valid_port(port): - print "Error: Unrecognized portname " + port + print("Error: Unrecognized portname " + port) return False elif range_separator in keys: range_list = keys.split(range_separator) for port_val in range_list: if not check_valid_port(port_val): - print "Error: Unrecognized portname " + port_val - print "Invalid range " + keys + print("Error: Unrecognized portname " + port_val) + print("Invalid range " + keys) return False else: - print "Invalid range " + keys + print("Invalid range " + keys) return False if not check_media_dict(global_media_dict[keys]): @@ -110,7 +117,7 @@ def check_file(media_settings_file): for key_l1 in media_dict: if key_l1 not in level1_keys: - print "Error: Unknown key " + key_l1 + " at top level" + print("Error: Unknown key " + key_l1 + " at top level") return False if "GLOBAL_MEDIA_SETTINGS" in media_dict: if not check_global_keys(media_dict["GLOBAL_MEDIA_SETTINGS"]): @@ -121,11 +128,11 @@ def check_file(media_settings_file): except IOError: - print "Error: Cannot open file " + media_settings_file + print("Error: Cannot open file " + media_settings_file) return False - except ValueError,e: - print "Error in parsing json file " + media_settings_file + " " - print str(e) + except ValueError as e: + print("Error in parsing json file " + media_settings_file + " ") + print(str(e)) return False return True @@ -146,14 +153,15 @@ def main(argv): for f in files: good = check_file(f) if good: - print "File " + f + " passed validity check" + print("File " + f + " passed validity check") else: - print "File " + f + " failed validity check" + print("File " + f + " failed validity check") all_good = all_good and good if not all_good: sys.exit(-1) + if __name__ == "__main__": main(sys.argv[1:]) diff --git a/src/sonic-device-data/tests/platform_json_checker b/src/sonic-device-data/tests/platform_json_checker index c0257a27e80c..1612c0082c1d 100755 --- a/src/sonic-device-data/tests/platform_json_checker +++ b/src/sonic-device-data/tests/platform_json_checker @@ -1,17 +1,9 @@ -#!/usr/bin/env python -try: - import re - import sys - import glob - import json -except ImportError as e: - raise ImportError (str(e) + "- required module not found") - -# TODO: need to remove basestring once migrate to Python 3 and just change to str -try: - basestring -except NameError: - basestring = str +#!/usr/bin/env python3 + +import glob +import json +import re +import sys # Global variable PORT_ATTRIBUTES = ["index", "lanes", "alias_at_lanes", "breakout_modes"] @@ -20,24 +12,26 @@ PORT_REG = "Ethernet(\d+)" PLATFORM_JSON = '*platform.json' INTF_KEY = "interfaces" + def usage(): - print "Usage: " + sys.argv[0] + " " + print("Usage: " + sys.argv[0] + " ") sys.exit(1) + def check_port_attr(port_attr): for each_key in port_attr: if each_key not in PORT_ATTRIBUTES: - print "Error: "+ each_key + " is not the correct Port attribute." + print("Error: "+ each_key + " is not the correct Port attribute.") return False if not port_attr[each_key]: - print "Error: "+ each_key + " has no value." + print("Error: "+ each_key + " has no value.") return False - # TODO: need to remove basestring once migrate to Python 3 and just change to str - if not isinstance(port_attr[each_key], basestring): - print "Error:value type of "+ each_key + " must be string." + if not isinstance(port_attr[each_key], str): + print("Error:value type of "+ each_key + " must be string.") return False return True + def check_file(platform_json_file): try: platform_cap_file = open(platform_json_file,"r") @@ -48,29 +42,30 @@ def check_file(platform_json_file): # Validate port at top level port_id = re.search(PORT_REG, each_port) if port_id is None: - print "Error: Unknown Interface " + str(each_port) + " at top level" + print("Error: Unknown Interface " + str(each_port) + " at top level") return False - total_attr = len(port_dict[INTF_KEY][each_port].keys()) + total_attr = len(list(port_dict[INTF_KEY][each_port].keys())) port_attr = port_dict[INTF_KEY][each_port] if total_attr != ATTR_LEN: missing_attr = ', '.join(set(PORT_ATTRIBUTES).difference(list(port_attr))) - print "Error: " + missing_attr + " of " + each_port + " is/are missing" + print("Error: " + missing_attr + " of " + each_port + " is/are missing") return False #Validate port attributes for each port if not check_port_attr(port_attr): return False except IOError: - print "Error: Cannot open file " + platform_json_file + print("Error: Cannot open file " + platform_json_file) return False - except ValueError,e: - print "Error in parsing json file " + platform_json_file + " " - print str(e) + except ValueError as e: + print("Error in parsing json file " + platform_json_file + " ") + print(str(e)) return False return True + def main(argv): if len(argv) > 0 and argv[0] == "-h": usage() @@ -86,14 +81,15 @@ def main(argv): for f in files: good = check_file(f) if good: - print "File " + f + " passed validity check" + print("File " + f + " passed validity check") else: - print "File " + f + " failed validity check" + print("File " + f + " failed validity check") all_good = all_good and good if not all_good: sys.exit(-1) + if __name__ == "__main__": main(sys.argv[1:]) From d8045987a60d0ce27d3859f07cbabc4d01ec9091 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 5 Nov 2020 11:19:26 -0800 Subject: [PATCH 3/8] [core_uploader.py] Convert to Python 3; Use logger from sonic-py-common for uniform logging (#5790) - Convert core_uploader.py script to Python 3 - Use logger from sonic-py-common for uniform logging - Reorganize imports alphabetically per PEP8 standard - Two blank lines precede functions per PEP8 standard - Remove unnecessary global variable declarations --- .../build_templates/sonic_debian_extension.j2 | 2 + .../corefile_uploader/core_uploader.py | 75 +++++++------------ 2 files changed, 30 insertions(+), 47 deletions(-) diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index c322c58aa003..52b6205e1487 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -339,7 +339,9 @@ sudo chmod og-rw $FILESYSTEM_ROOT_ETC_SONIC/core_analyzer.rc.json sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install libffi-dev libssl-dev sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install azure-storage==0.36.0 +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install azure-storage==0.36.0 sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install watchdog==0.10.2 +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install watchdog==0.10.3 sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install futures==3.3.0 {% if include_kubernetes == "y" %} diff --git a/files/image_config/corefile_uploader/core_uploader.py b/files/image_config/corefile_uploader/core_uploader.py index 2ae91ce0896b..4807425f4307 100755 --- a/files/image_config/corefile_uploader/core_uploader.py +++ b/files/image_config/corefile_uploader/core_uploader.py @@ -1,25 +1,19 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +import json import os -import time -import tarfile import socket +import tarfile +import time + import yaml -import json -import syslog +from azure.storage.file import FileService +from sonic_py_common.logger import Logger from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler -from azure.storage.file import FileService - -global CORE_FILE_PATH, RC_FILE -global hostname, sonicversion, asicname, acctname, acctkey, sharename, cwd -global INIT_CWD -global log_level -global this_file -this_file = os.path.basename(__file__) +SYSLOG_IDENTIFIER = os.path.basename(__file__) -global cfg cfg = "" CORE_FILE_PATH = "/var/core/" @@ -42,32 +36,16 @@ MAX_RETRIES = 5 UPLOAD_PREFIX = "UPLOADED_" -log_level = syslog.LOG_DEBUG - -def log_msg(lvl, fname, m): - if (lvl <= log_level): - syslog.syslog(lvl, "{}: {}".format(fname, m)) - - if log_level == syslog.LOG_DEBUG: - print("{}: {}".format(fname, m)) - -def log_err(m): - log_msg(syslog.LOG_ERR, this_file, m) - -def log_info(m): - log_msg(syslog.LOG_INFO, this_file, m) - -def log_warn(m): - log_msg(syslog.LOG_WARNING, this_file, m) - -def log_debug(m): - log_msg(syslog.LOG_DEBUG, this_file, m) +# Global logger instance +logger = Logger(SYSLOG_IDENTIFIER) +logger.set_min_log_priority_info() def make_new_dir(p): os.system("rm -rf " + p) os.system("mkdir -p " + p) + def parse_a_json(data, prefix, val): for i in data: if type(data[i]) == dict: @@ -75,6 +53,7 @@ def parse_a_json(data, prefix, val): else: val[prefix + (i,)] = data[i] + class config: parsed_data = {} cfg_data = {} @@ -82,7 +61,7 @@ class config: def __init__(self): while not os.path.exists(RC_FILE): # Wait here until service restart - log_err("Unable to retrieve Azure storage credentials") + logger.log_error("Unable to retrieve Azure storage credentials") time.sleep (HOURS_4) with open(RC_FILE, 'r') as f: @@ -90,7 +69,7 @@ def __init__(self): parse_a_json(self.parsed_data, (), self.cfg_data) def get_data(self, k): - return self.cfg_data[k] if self.cfg_data.has_key(k) else "" + return self.cfg_data[k] if k in self.cfg_data else "" def get_dict(self): return self.parsed_data @@ -123,15 +102,17 @@ def run(self): time.sleep(POLL_SLEEP) except: self.observer.stop() - log_err("Error in watcher") + logger.log_error("Error in watcher") self.observer.join() + def set_env(lst): for k in lst: if lst[k]: os.environ[k] = lst[k] - log_debug("set env {} = {}".format(k, lst[k])) + logger.log_debug("set env {} = {}".format(k, lst[k])) + class Handler(FileSystemEventHandler): @@ -155,7 +136,7 @@ def init(): if not acctname or not acctkey or not sharename: while True: # Wait here until service restart - log_err("Unable to retrieve Azure storage credentials") + logger.log_error("Unable to retrieve Azure storage credentials") time.sleep (HOURS_4) with open("/etc/sonic/sonic_version.yml", 'r') as stream: @@ -182,7 +163,7 @@ def on_any_event(event): elif event.event_type == 'created': # Take any action here when a file is first created. - log_debug("Received create event - " + event.src_path) + logger.log_debug("Received create event - " + event.src_path) Handler.wait_for_file_write_complete(event.src_path) Handler.handle_file(event.src_path) @@ -205,7 +186,7 @@ def wait_for_file_write_complete(path): raise Exception("Dump file creation is too slow: " + path) # Give up as something is terribly wrong with this file. - log_debug("File write complete - " + path) + logger.log_debug("File write complete - " + path) @staticmethod @@ -227,11 +208,11 @@ def handle_file(path): tar.add(metafiles[e]) tar.add(path) tar.close() - log_debug("Tar file for upload created: " + tarf_name) + logger.log_debug("Tar file for upload created: " + tarf_name) Handler.upload_file(tarf_name, tarf_name, path) - log_debug("File uploaded - " + path) + logger.log_debug("File uploaded - " + path) os.chdir(INIT_CWD) @staticmethod @@ -250,16 +231,16 @@ def upload_file(fname, fpath, coref): e.append(l[len(e)]) svc.create_directory(sharename, "/".join(e)) - log_debug("Remote dir created: " + "/".join(e)) + logger.log_debug("Remote dir created: " + "/".join(e)) svc.create_file_from_path(sharename, "/".join(l), fname, fpath) - log_debug("Remote file created: name{} path{}".format(fname, fpath)) + logger.log_debug("Remote file created: name{} path{}".format(fname, fpath)) newcoref = os.path.dirname(coref) + "/" + UPLOAD_PREFIX + os.path.basename(coref) os.rename(coref, newcoref) break except Exception as ex: - log_err("core uploader failed: Failed during upload (" + coref + ") err: ("+ str(ex) +") retry:" + str(i)) + logger.log_error("core uploader failed: Failed during upload (" + coref + ") err: ("+ str(ex) +") retry:" + str(i)) if not os.path.exists(fpath): break i += 1 @@ -281,5 +262,5 @@ def scan(): Handler.scan() w.run() except Exception as e: - log_err("core uploader failed: " + str(e) + " Exiting ...") + logger.log_err("core uploader failed: " + str(e) + " Exiting ...") From 13ff7b38d52f4afb98dc4a560f1599fcb441146c Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Thu, 5 Nov 2020 11:23:00 -0800 Subject: [PATCH 4/8] [docker-wait-any] Convert to Python 3, install dependency in host OS (#5784) - Convert docker-wait-any script to Python 3 - Install Python 3 Docker Engine API in host OS --- build_debian.sh | 8 +++++--- files/image_config/misc/docker-wait-any | 5 ++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index 2bb284182db1..2cea52e9e466 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -413,13 +413,15 @@ done < files/image_config/sysctl/sysctl-net.conf sudo augtool --autosave "$sysctl_net_cmd_string" -r $FILESYSTEM_ROOT -## docker Python API package is needed by Ansible docker module -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install 'docker==4.1.0' +# docker Python API package is needed by Ansible docker module as well as some SONiC applications +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install 'docker==4.1.0' +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'docker==4.3.1' + ## Note: keep pip installed for maintainance purpose ## Get gcc and python dev pkgs sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install gcc libpython2.7-dev -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install 'netifaces==0.10.7' +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install 'netifaces==0.10.7' ## Create /var/run/redis folder for docker-database to mount sudo mkdir -p $FILESYSTEM_ROOT/var/run/redis diff --git a/files/image_config/misc/docker-wait-any b/files/image_config/misc/docker-wait-any index d006aec47a5a..8d98e1f36a37 100755 --- a/files/image_config/misc/docker-wait-any +++ b/files/image_config/misc/docker-wait-any @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ docker-wait-any @@ -23,7 +23,7 @@ cases where we need the dependent container to be warm-restarted without affecting other services (eg: warm restart of teamd service) - NOTE: This script is written against docker Python package 4.1.0. Newer + NOTE: This script is written against docker Python package 4.3.1. Newer versions of docker may have a different API. """ import argparse @@ -68,7 +68,6 @@ def main(): docker_client = APIClient(base_url='unix://var/run/docker.sock') parser = argparse.ArgumentParser(description='Wait for dependent docker services', - version='1.0.0', formatter_class=argparse.RawTextHelpFormatter, epilog=""" Examples: From cea364aa7754a0d54e7deb3eb0462927c4d22117 Mon Sep 17 00:00:00 2001 From: Danny Allen Date: Fri, 6 Nov 2020 00:58:49 -0800 Subject: [PATCH 5/8] [utilities] Update sonic-utilities submodule (#5814) Add a switch to route_check to control whether write log to syslog (#1215) [consutil] Store console port state in STATE_DB (#1208) [sfputil] Display 'N/A' for non-SFP ports (#1078) Show FG_NHG CLI Commands Added (#1056) [show] remove 'device2interface_dict' in show interface neighbor expected (#1188) Add license file, remove third-party licenses file (#1192) [fwutil]: Set min log priority to INFO. (#1191) [CLI][show][platform] Added ASIC count in the output. (#1185) fdbshow and nbrshow use SonicV2Connector with decode_responses=True, and remove all the decode() (#1187) Remove stdeb.cfg; no longer used now that we build as wheel (#1182) [counterpoll] Disable Counter Poll When Entering Fast Reboot (#1174) Fixes the issue with show interface counters and for pfc and queue counters. (#1180) [config/show] Add CLI support for proxy arp (#1168) [consutil] Add brief option to show line command (#1176) Modify fast-reboot script to use BGP service script to stop bgp service (#1177) [config/console] Support update console configuration related commands (#1166) [consutil] Fix issue where the show line command crash if no ttyUSB exists (#1173) [watermarkstat] Add unit tests for watermarkstat show commands (#1157) Fix exception for ipaddress in python2 (#1164) [celestica] consutil to support customize tty device name (#1155) Signed-off-by: Danny Allen --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index b6af9f48e298..acfa8248d799 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit b6af9f48e29852985137a57ff5396591af7f107c +Subproject commit acfa8248d79970e4d0225dd08082dc8f85ad030d From 51292330e98dad392995bdcfa2410ca1c7fe490a Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Fri, 6 Nov 2020 09:00:19 -0800 Subject: [PATCH 6/8] [enable_counters.py] Convert to Python 3 (#5789) **- Why I did it** As part of moving all SONiC code from Python 2 (no longer supported) to Python 3 **- How I did it** - Convert enable_counters.py script to Python 3 - Reorganize imports per PEP8 standard - Two blank lines precede functions per PEP8 standard --- dockers/docker-orchagent/enable_counters.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dockers/docker-orchagent/enable_counters.py b/dockers/docker-orchagent/enable_counters.py index 5178684c5e16..2067baefbfb7 100755 --- a/dockers/docker-orchagent/enable_counters.py +++ b/dockers/docker-orchagent/enable_counters.py @@ -1,13 +1,16 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 -import swsssdk import time +import swsssdk + + def enable_counter_group(db, name): info = {} info['FLEX_COUNTER_STATUS'] = 'enable' db.mod_entry("FLEX_COUNTER_TABLE", name, info) + def enable_counters(): db = swsssdk.ConfigDBConnector() db.connect() @@ -20,10 +23,12 @@ def enable_counters(): enable_counter_group(db, 'BUFFER_POOL_WATERMARK') enable_counter_group(db, 'PORT_BUFFER_DROP') + def get_uptime(): with open('/proc/uptime') as fp: return float(fp.read().split(' ')[0]) + def main(): # If the switch was just started (uptime less than 5 minutes), # wait for 3 minutes and enable counters @@ -35,5 +40,6 @@ def main(): time.sleep(60) enable_counters() + if __name__ == '__main__': main() From f506c9a42aab0d86709bcbe87cfedf15371dc79d Mon Sep 17 00:00:00 2001 From: Madhan Babu Date: Thu, 5 Nov 2020 20:42:10 +0200 Subject: [PATCH 7/8] updating submodule changes --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index acfa8248d799..99de1678e25f 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit acfa8248d79970e4d0225dd08082dc8f85ad030d +Subproject commit 99de1678e25fd8499dadb2044802a1b6ab388b50 From 40b2e04c6a6d42e5932d930c2a6817f0d948992a Mon Sep 17 00:00:00 2001 From: Madhan Babu Date: Fri, 6 Nov 2020 20:00:16 +0200 Subject: [PATCH 8/8] resolving merge conflicts --- src/sonic-utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-utilities b/src/sonic-utilities index 99de1678e25f..b6af9f48e298 160000 --- a/src/sonic-utilities +++ b/src/sonic-utilities @@ -1 +1 @@ -Subproject commit 99de1678e25fd8499dadb2044802a1b6ab388b50 +Subproject commit b6af9f48e29852985137a57ff5396591af7f107c