From e0fdf45ad09f770c9de14a0da7721e36d72d306d Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Mon, 9 Nov 2020 08:35:36 -0800 Subject: [PATCH] [update_chassisdb_config] Convert to Python 3 (#5838) - Convert update_chassisdb_config script to Python 3 - Reorganize imports per PEP8 standard - Two blank lines precede functions per PEP8 standard --- files/scripts/update_chassisdb_config | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/files/scripts/update_chassisdb_config b/files/scripts/update_chassisdb_config index 7ed1f2284c..6b94033704 100755 --- a/files/scripts/update_chassisdb_config +++ b/files/scripts/update_chassisdb_config @@ -1,13 +1,15 @@ -#!/usr/bin/python +#!/usr/bin/python3 + +import argparse import json import os import syslog -import argparse database_config_file = "/var/run/redis/sonic-db/database_config.json" redis_chassis = 'redis_chassis' chassis_db = 'CHASSIS_APP_DB' + def main(): parser = argparse.ArgumentParser(description= "Update chassis_db config from database-config.json") @@ -63,5 +65,6 @@ def main(): syslog.syslog(syslog.LOG_INFO, 'remove chassis_db from config file {}'.format(jsonfile)) + if __name__ == "__main__": main()