diff options
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/config/cc_snappy.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/config/cc_snappy.py b/cloudinit/config/cc_snappy.py index e36542bf..899df10c 100644 --- a/cloudinit/config/cc_snappy.py +++ b/cloudinit/config/cc_snappy.py @@ -280,10 +280,12 @@ def handle(name, cfg, cloud, log, args): # If the user has not explicitly enabled or disabled SSH, then enable it # when password SSH authentication is requested or there are SSH keys if mycfg.get('ssh_enabled', None) is not False: - if len(mycfg.get('public-keys', [])) > 0: + user_ssh_keys = cloud.get_public_ssh_keys() or None + password_auth_enabled = cfg.get('ssh_pwauth', False) + if user_ssh_keys: LOG.debug("Enabling SSH, user SSH keys provided") ssh_enabled = True - elif mycfg.get('ssh_pwauth', False): + elif password_auth_enabled: LOG.debug("Enabling SSH, password authentication requested") ssh_enabled = True |