examples/ncclient: set default log level to INFO 09/14409/1
authorMarek Gradzki <[email protected]>
Wed, 22 Aug 2018 07:41:18 +0000 (09:41 +0200)
committerMarek Gradzki <[email protected]>
Wed, 22 Aug 2018 07:41:18 +0000 (09:41 +0200)
Change-Id: I959045c8d7ec16291f7144c572faea06cf1ad433
Signed-off-by: Marek Gradzki <[email protected]>
examples/ncclient/copy_config.py
examples/ncclient/edit_config.py
examples/ncclient/get.py
examples/ncclient/get_config.py

index 227acb1..f397aaa 100755 (executable)
@@ -25,9 +25,9 @@ def _copy_config(config_filename, host='localhost', port=2831, username='admin',
         logger.info("Connected to HC")
         with open(config_filename, 'r') as f:
             ret = m.copy_config(target='candidate', source=_SOURCE_TEMPLATE % f.read())
-            logger.debug("CopyConfig successful:\n%s" % ret)
+            logger.info("<copy-config> successful:\n%s" % ret)
         ret = m.commit()
-        logger.debug("Commit successful:\n%s", ret)
+        logger.info("<commit> successful:\n%s", ret)
 
 
 if __name__ == '__main__':
@@ -40,6 +40,6 @@ if __name__ == '__main__':
     if args.verbose:
         logging.basicConfig(level=logging.DEBUG)
     else:
-        logging.basicConfig(level=logging.WARNING)
+        logging.basicConfig(level=logging.INFO)
 
     _copy_config(args.config_filename)
index d43b0b7..741232b 100755 (executable)
@@ -24,11 +24,11 @@ def _edit_config(config_filename, host='localhost', port=2831, username='admin',
         logger.info("Connected to HC")
         with open(config_filename, 'r') as f:
             ret = m.edit_config(config=f.read())
-            logger.debug("EditConfig successful:\n%s" % ret)
+            logger.info("<edit-config> successful:\n%s" % ret)
             validate = m.validate()
-            logger.debug("Validate successful:\n%s" % validate)
+            logger.info("<validate> successful:\n%s" % validate)
             commit = m.commit()
-            logger.debug("Commit successful:\n%s" % commit)
+            logger.info("<commit> successful:\n%s" % commit)
 
 if __name__ == '__main__':
     argparser = argparse.ArgumentParser(description="Configures VPP using <edit-config> RPC")
@@ -44,6 +44,6 @@ if __name__ == '__main__':
     if args.verbose:
         logging.basicConfig(level=logging.DEBUG)
     else:
-        logging.basicConfig(level=logging.WARNING)
+        logging.basicConfig(level=logging.INFO)
 
     _edit_config(args.config_filename, validate=args.validate, commit=args.commit)
index 44a7260..999304f 100755 (executable)
@@ -22,7 +22,7 @@ def _get(reply_filename=None, host='localhost', port=2831, username='admin', pas
     with manager.connect(host=host, port=port, username=username, password=password, hostkey_verify=False) as m:
         logger.info("Connected to HC")
         state = m.get()
-        logger.debug("Get successful:\n%s" % state)
+        logger.info("<get> successful:\n%s" % state)
         if reply_filename:
             with open(reply_filename, 'w') as f:
                 f.write(state.data_xml)
@@ -40,6 +40,6 @@ if __name__ == '__main__':
     if args.verbose:
         logging.basicConfig(level=logging.DEBUG)
     else:
-        logging.basicConfig(level=logging.WARNING)
+        logging.basicConfig(level=logging.INFO)
 
     _get(args.reply_filename)
index 53b6854..631926e 100755 (executable)
@@ -22,7 +22,7 @@ def _get_config(reply_filename=None, host='localhost', port=2831, username='admi
     with manager.connect(host=host, port=port, username=username, password=password, hostkey_verify=False) as m:
         logger.info("Connected to HC")
         config = m.get_config(source='running')
-        logger.debug("GetConfig successful:\n%s" % config)
+        logger.info("<get-config> successful:\n%s" % config)
         if reply_filename:
             with open(reply_filename, 'w') as f:
                 f.write(config.data_xml)
@@ -40,6 +40,6 @@ if __name__ == '__main__':
     if args.verbose:
         logging.basicConfig(level=logging.DEBUG)
     else:
-        logging.basicConfig(level=logging.WARNING)
+        logging.basicConfig(level=logging.INFO)
 
     _get_config(args.reply_filename)