summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2010-01-26 15:51:38 -0500
committerScott Moser <smoser@ubuntu.com>2010-01-26 15:51:38 -0500
commit930328be289ec7ab243b50360a73dab10f17844a (patch)
tree6909abd92c68d9859caa2f3c3d2ffd2496487122
parent262479dfe04e8342843df8851eaef61caaa95f5a (diff)
downloadvyos-cloud-init-930328be289ec7ab243b50360a73dab10f17844a.tar.gz
vyos-cloud-init-930328be289ec7ab243b50360a73dab10f17844a.zip
support reading keys from ssh_authorized_keys field of cloud-config
-rw-r--r--ec2init/CloudConfig.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ec2init/CloudConfig.py b/ec2init/CloudConfig.py
index 84b00fd8..6c661260 100644
--- a/ec2init/CloudConfig.py
+++ b/ec2init/CloudConfig.py
@@ -162,6 +162,11 @@ class CloudConfig():
user = util.get_cfg_option_str(self.cfg,'user')
disable_root = util.get_cfg_option_bool(self.cfg, "disable_root", True)
keys = self.cloud.get_public_ssh_keys()
+
+ if self.cfg.has_key("ssh_authorized_keys"):
+ cfgkeys = self.cfg["ssh_authorized_keys"]
+ keys.extend(cfgkeys)
+
apply_credentials(keys,user,disable_root)
except:
warn("applying credentials failed!\n")
@@ -179,6 +184,7 @@ class CloudConfig():
def apply_credentials(keys, user, disable_root):
+ keys = set(keys)
if user:
setup_user_keys(keys, user, '')