From 6b0a1629c1c0c2a95e9e5946d8120d521c33322a Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 18 Jan 2011 20:33:57 +0000 Subject: 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 --- cloudinit/CloudConfig/cc_ssh_import_id.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'cloudinit/CloudConfig') 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 -- cgit v1.2.3