From a92966bf867f30a67a71b007bc170e0b1686efe2 Mon Sep 17 00:00:00 2001 From: Marek Gradzki Date: Wed, 22 Aug 2018 09:52:43 +0200 Subject: examples/ncclient: make validate and commit optional Change-Id: I9da8729b58500d18c82981284c44ad07bcbee167 Signed-off-by: Marek Gradzki --- examples/ncclient/edit_config.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/ncclient/edit_config.py b/examples/ncclient/edit_config.py index 741232b51..598770738 100755 --- a/examples/ncclient/edit_config.py +++ b/examples/ncclient/edit_config.py @@ -25,10 +25,12 @@ def _edit_config(config_filename, host='localhost', port=2831, username='admin', with open(config_filename, 'r') as f: ret = m.edit_config(config=f.read()) logger.info(" successful:\n%s" % ret) - validate = m.validate() - logger.info(" successful:\n%s" % validate) - commit = m.commit() - logger.info(" successful:\n%s" % commit) + if validate: + ret = m.validate() + logger.info(" successful:\n%s" % ret) + if commit: + ret = m.commit() + logger.info(" successful:\n%s" % ret) if __name__ == '__main__': argparser = argparse.ArgumentParser(description="Configures VPP using RPC") -- cgit 1.2.3-korg