From 4b89bde850a779b604352436f0b8a59e351bc08d Mon Sep 17 00:00:00 2001 From: Dennis Kennetz Date: Wed, 7 Apr 2021 14:23:29 -0500 Subject: [PATCH] added an asRoot flag to run the commented out code create_user_credentials if flag is passed. --- scripts/cyclecloud_install.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/cyclecloud_install.py b/scripts/cyclecloud_install.py index 8144790..87d4648 100644 --- a/scripts/cyclecloud_install.py +++ b/scripts/cyclecloud_install.py @@ -497,6 +497,10 @@ def main(): dest="acceptTerms", action="store_true", help="Accept Cyclecloud terms and do a silent install") + parser.add_argument("--asRoot", + dest="asRoot", + action="store_true", + help="use asRoot if running as root user to create user credentials for cyclecloud account.") parser.add_argument("--useLetsEncrypt", dest="useLetsEncrypt", @@ -601,7 +605,8 @@ def main(): letsEncrypt(args.hostname, vm_metadata["compute"]["location"]) # Create user requires root privileges - # create_user_credential(args.username, args.publickey) + if args.asRoot: + create_user_credential(args.username, args.publickey) clean_up()