diff options
| author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-15 21:33:55 -0700 |
|---|---|---|
| committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-15 21:33:55 -0700 |
| commit | 450261a1fcf1f8929a2f7a25c2c278ba40689289 (patch) | |
| tree | 83430d74ea63c5a11df3fb774e281d0f8efce8f3 /cloudinit/transforms/cc_ssh_import_id.py | |
| parent | 784edb7689d60b81a4334d5171603841cc83da98 (diff) | |
| download | vyos-cloud-init-450261a1fcf1f8929a2f7a25c2c278ba40689289.tar.gz vyos-cloud-init-450261a1fcf1f8929a2f7a25c2c278ba40689289.zip | |
Fixups to ensure that pylint does not find anything major wrong.
Diffstat (limited to 'cloudinit/transforms/cc_ssh_import_id.py')
| -rw-r--r-- | cloudinit/transforms/cc_ssh_import_id.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cloudinit/transforms/cc_ssh_import_id.py b/cloudinit/transforms/cc_ssh_import_id.py index 019413d4..d57e4665 100644 --- a/cloudinit/transforms/cc_ssh_import_id.py +++ b/cloudinit/transforms/cc_ssh_import_id.py @@ -33,10 +33,14 @@ def handle(name, cfg, _cloud, log, args): ids = args[1:] else: user = util.get_cfg_option_str(cfg, "user", "ubuntu") - ids = util.get_cfg_option_list_or_str(cfg, "ssh_import_id", []) + ids = util.get_cfg_option_list(cfg, "ssh_import_id", []) if len(ids) == 0: - log.debug("Skipping module named %s, no ids found to import", name) + log.debug("Skipping transform named %s, no ids found to import", name) + return + + if not user: + log.debug("Skipping transform named %s, no user found to import", name) return cmd = ["sudo", "-Hu", user, "ssh-import-id"] + ids |
