summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig/cc_mcollective.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_mcollective.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_mcollective.py')
-rw-r--r--cloudinit/CloudConfig/cc_mcollective.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/cloudinit/CloudConfig/cc_mcollective.py b/cloudinit/CloudConfig/cc_mcollective.py
index 8ad8caab..2b8b2f96 100644
--- a/cloudinit/CloudConfig/cc_mcollective.py
+++ b/cloudinit/CloudConfig/cc_mcollective.py
@@ -27,11 +27,13 @@ import cloudinit.util as util
pubcert_file = "/etc/mcollective/ssl/server-public.pem"
pricert_file = "/etc/mcollective/ssl/server-private.pem"
+
# Our fake header section
class FakeSecHead(object):
def __init__(self, fp):
self.fp = fp
self.sechead = '[nullsection]\n'
+
def readline(self):
if self.sechead:
try:
@@ -41,16 +43,17 @@ class FakeSecHead(object):
else:
return self.fp.readline()
+
def handle(_name, cfg, _cloud, _log, _args):
# If there isn't a mcollective key in the configuration don't do anything
- if not cfg.has_key('mcollective'):
+ if 'mcollective' not in cfg:
return
mcollective_cfg = cfg['mcollective']
# Start by installing the mcollective package ...
cc.install_packages(("mcollective",))
# ... and then update the mcollective configuration
- if mcollective_cfg.has_key('conf'):
+ if 'conf' in mcollective_cfg:
# Create object for reading server.cfg values
mcollective_config = ConfigParser.ConfigParser()
# Read server.cfg values from original file in order to be able to mix
@@ -92,4 +95,3 @@ def handle(_name, cfg, _cloud, _log, _args):
# Start mcollective
subprocess.check_call(['service', 'mcollective', 'start'])
-