summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-01-17 15:33:07 -0500
committerScott Moser <smoser@ubuntu.com>2012-01-17 15:33:07 -0500
commit8ffe7b00528f6d5abe9ffad6b6e615fb564261be (patch)
treeb6c6a33ad6f5eacc87692425319522addc67156e
parentd778a9e6e070d7aa989e49cc517e5087d1a4c795 (diff)
downloadvyos-cloud-init-8ffe7b00528f6d5abe9ffad6b6e615fb564261be.tar.gz
vyos-cloud-init-8ffe7b00528f6d5abe9ffad6b6e615fb564261be.zip
remove usage of global (no longer need --disable=W0603)
-rw-r--r--cloudinit/CloudConfig/cc_ssh.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/cloudinit/CloudConfig/cc_ssh.py b/cloudinit/CloudConfig/cc_ssh.py
index 39862117..cdf90bdc 100644
--- a/cloudinit/CloudConfig/cc_ssh.py
+++ b/cloudinit/CloudConfig/cc_ssh.py
@@ -25,12 +25,8 @@ DISABLE_ROOT_OPTS = "no-port-forwarding,no-agent-forwarding," \
"no-X11-forwarding,command=\"echo \'Please login as the user \\\"$USER\\\" " \
"rather than the user \\\"root\\\".\';echo;sleep 10\""
-global_log = None
-
def handle(_name, cfg, cloud, log, _args):
- global global_log
- global_log = log
# remove the static keys from the pristine image
if cfg.get("ssh_deletekeys", True):
@@ -87,14 +83,14 @@ def handle(_name, cfg, cloud, log, _args):
cfgkeys = cfg["ssh_authorized_keys"]
keys.extend(cfgkeys)
- apply_credentials(keys, user, disable_root, disable_root_opts)
+ apply_credentials(keys, user, disable_root, disable_root_opts, log)
except:
util.logexc(log)
log.warn("applying credentials failed!\n")
def apply_credentials(keys, user, disable_root,
- disable_root_opts=DISABLE_ROOT_OPTS, log=global_log):
+ disable_root_opts=DISABLE_ROOT_OPTS, log=None):
keys = set(keys)
if user:
sshutil.setup_user_keys(keys, user, '', log)