summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_ssh_import_id.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/config/cc_ssh_import_id.py')
-rw-r--r--cloudinit/config/cc_ssh_import_id.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/cloudinit/config/cc_ssh_import_id.py b/cloudinit/config/cc_ssh_import_id.py
index e733d14a..9aee2166 100644
--- a/cloudinit/config/cc_ssh_import_id.py
+++ b/cloudinit/config/cc_ssh_import_id.py
@@ -32,12 +32,13 @@ def handle(name, cfg, cloud, log, args):
if len(args) > 1:
ids = args[1:]
else:
- user = None
+ user = cloud.distro.get_default_user()
- try:
- user = cloud.distro.get_configured_user()
- except NotImplementedError:
- pass
+ if 'users' in cfg:
+ user_zero = cfg['users'].keys()[0]
+
+ if user_zero != "default":
+ user = user_zero
ids = util.get_cfg_option_list(cfg, "ssh_import_id", [])