summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-01-18 20:33:57 +0000
committerScott Moser <smoser@ubuntu.com>2011-01-18 20:33:57 +0000
commit6b0a1629c1c0c2a95e9e5946d8120d521c33322a (patch)
treecbcdf6eababc1c58518ea0f5972edf646aec1ca4
parentc11b93cf03e4ff0dd90c83d09f27c512513be9b7 (diff)
downloadvyos-cloud-init-6b0a1629c1c0c2a95e9e5946d8120d521c33322a.tar.gz
vyos-cloud-init-6b0a1629c1c0c2a95e9e5946d8120d521c33322a.zip
revert previous commit that special cased 'ssh_import_id' on cmdline
Instead of: root=LABEL=uec-rootfs ro console=hvc0 ssh_import_id=smoser We now have more generic: root=LABEL=uec-rootfs ro console=hvc0 cc:ssh_import_id: smoser
-rw-r--r--cloudinit/CloudConfig/cc_ssh_import_id.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/cloudinit/CloudConfig/cc_ssh_import_id.py b/cloudinit/CloudConfig/cc_ssh_import_id.py
index 9dd2159a..bf1314be 100644
--- a/cloudinit/CloudConfig/cc_ssh_import_id.py
+++ b/cloudinit/CloudConfig/cc_ssh_import_id.py
@@ -20,30 +20,15 @@ import subprocess
import traceback
def handle(name,cfg,cloud,log,args):
- ids = [ ]
if len(args) != 0:
user = args[0]
+ ids = [ ]
if len(args) > 1:
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",[])
- try:
- fp = open("/proc/cmdline")
- cmdline = fp.read()
- fp.close()
- names = [ "ssh_import_id", "ssh_import" ]
- cmd_ids = [ ]
- for i in cmdline.strip().split():
- for n in names:
- if i.startswith(n + "="):
- print i
- cmd_ids=i[len(n)+1:].split(",")
- ids.extend(cmd_ids)
- except:
- log.warn("failed to read /proc/cmdline for import_id")
-
if len(ids) == 0: return
cmd = [ "sudo", "-Hu", user, "ssh-import-id" ] + ids