Support setting custom path to config file in helper scripts
[integration.git] / test / vcpe / get_info.py
index 2d52a07..62e428a 100755 (executable)
@@ -11,11 +11,18 @@ import base64
 from vcpecommon import *
 import preload
 import vcpe_custom_service
+import argparse
 
+# Run the script with [-h|--help] to get usage info
 
 logging.basicConfig(level=logging.INFO, format='%(message)s')
 
-vcpecommon = VcpeCommon()
+parser = argparse.ArgumentParser(formatter_class=
+                                 argparse.ArgumentDefaultsHelpFormatter)
+parser.add_argument('--config',help='Configuration file path',default=None)
+args = parser.parse_args()
+
+vcpecommon = VcpeCommon(cfg_file=args.config)
 nodes=['brg', 'bng', 'mux', 'dhcp']
 hosts = vcpecommon.get_vm_ip(nodes)
 print(json.dumps(hosts, indent=4, sort_keys=True))