summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig/cc_ssh_import_id.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-01-17 14:41:29 -0500
committerScott Moser <smoser@ubuntu.com>2012-01-17 14:41:29 -0500
commit15e3241ba725a21604e0f3570e755a91b5edba00 (patch)
treed84be61c3a56ddc03eb927d5de5433afacadf64b /cloudinit/CloudConfig/cc_ssh_import_id.py
parent2f7227c7092ad873757167f62c2a82fb4ee69472 (diff)
downloadvyos-cloud-init-15e3241ba725a21604e0f3570e755a91b5edba00.tar.gz
vyos-cloud-init-15e3241ba725a21604e0f3570e755a91b5edba00.zip
[PATCH] PEP8 coding style fixes.
From: Juerg Haefliger <juerg.haefliger@hp.com> This pulls in the named patch for LP: #914739 with a few other changes.
Diffstat (limited to 'cloudinit/CloudConfig/cc_ssh_import_id.py')
-rw-r--r--cloudinit/CloudConfig/cc_ssh_import_id.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/cloudinit/CloudConfig/cc_ssh_import_id.py b/cloudinit/CloudConfig/cc_ssh_import_id.py
index efcd4296..f14a99cd 100644
--- a/cloudinit/CloudConfig/cc_ssh_import_id.py
+++ b/cloudinit/CloudConfig/cc_ssh_import_id.py
@@ -19,10 +19,11 @@ import cloudinit.util as util
import subprocess
import traceback
+
def handle(_name, cfg, _cloud, log, args):
if len(args) != 0:
user = args[0]
- ids = [ ]
+ ids = []
if len(args) > 1:
ids = args[1:]
else:
@@ -32,7 +33,7 @@ def handle(_name, cfg, _cloud, log, args):
if len(ids) == 0:
return
- cmd = [ "sudo", "-Hu", user, "ssh-import-id" ] + ids
+ cmd = ["sudo", "-Hu", user, "ssh-import-id"] + ids
log.debug("importing ssh ids. cmd = %s" % cmd)
@@ -40,7 +41,7 @@ def handle(_name, cfg, _cloud, log, args):
subprocess.check_call(cmd)
except subprocess.CalledProcessError as e:
log.debug(traceback.format_exc(e))
- raise Exception("Cmd returned %s: %s" % ( e.returncode, cmd))
+ raise Exception("Cmd returned %s: %s" % (e.returncode, cmd))
except OSError as e:
log.debug(traceback.format_exc(e))
- raise Exception("Cmd failed to execute: %s" % ( cmd ))
+ raise Exception("Cmd failed to execute: %s" % (cmd))