From f751cf24fbcca2a72170498a29fcf213827977be Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Sun, 4 Dec 2016 23:36:28 +0530 Subject: [PATCH] update VM password databag only when there is vm_password.json configuration update from the management server from the managment server. With out thix fix, password data bag is getting updated on every network rule configuration and hence VR serving the password for guest instance password requests every time --- systemvm/patches/debian/config/opt/cloud/bin/configure.py | 8 +++++--- .../patches/debian/config/opt/cloud/bin/update_config.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/configure.py b/systemvm/patches/debian/config/opt/cloud/bin/configure.py index 11fad88164e..4cc16de0249 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/configure.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/configure.py @@ -921,9 +921,11 @@ def main(argv): config.address().compare() config.address().process() - logging.debug("Configuring vmpassword") - password = CsPassword("vmpassword", config) - password.process() + process_file = argv[1] + if process_file in ["cmd_line.json", "vm_password.json"]: + logging.debug("Configuring vmpassword") + password = CsPassword("vmpassword", config) + password.process() logging.debug("Configuring vmdata") metadata = CsVmMetadata('vmdata', config) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/update_config.py b/systemvm/patches/debian/config/opt/cloud/bin/update_config.py index 35a5cde363c..dddd0c8e3c0 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/update_config.py +++ b/systemvm/patches/debian/config/opt/cloud/bin/update_config.py @@ -41,7 +41,7 @@ currentGuestNetConfig = "/etc/cloudstack/guestnetwork.json" def finish_config(): # Converge - returncode = configure.main([]) + returncode = configure.main(sys.argv) sys.exit(returncode)