summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig/cc_byobu.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_byobu.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_byobu.py')
-rw-r--r--cloudinit/CloudConfig/cc_byobu.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/cloudinit/CloudConfig/cc_byobu.py b/cloudinit/CloudConfig/cc_byobu.py
index 04825521..7e455a7a 100644
--- a/cloudinit/CloudConfig/cc_byobu.py
+++ b/cloudinit/CloudConfig/cc_byobu.py
@@ -19,6 +19,7 @@ import cloudinit.util as util
import subprocess
import traceback
+
def handle(_name, cfg, _cloud, log, args):
if len(args) != 0:
value = args[0]
@@ -31,8 +32,8 @@ def handle(_name, cfg, _cloud, log, args):
if value == "user" or value == "system":
value = "enable-%s" % value
- valid = ( "enable-user", "enable-system", "enable",
- "disable-user", "disable-system", "disable" )
+ valid = ("enable-user", "enable-system", "enable",
+ "disable-user", "disable-system", "disable")
if not value in valid:
log.warn("Unknown value %s for byobu_by_default" % value)
@@ -59,7 +60,7 @@ def handle(_name, cfg, _cloud, log, args):
shcmd += " && dpkg-reconfigure byobu --frontend=noninteractive"
shcmd += " || X=$(($X+1)); "
- cmd = [ "/bin/sh", "-c", "%s %s %s" % ("X=0;", shcmd, "exit $X" ) ]
+ cmd = ["/bin/sh", "-c", "%s %s %s" % ("X=0;", shcmd, "exit $X")]
log.debug("setting byobu to %s" % value)
@@ -67,7 +68,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))