summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Howard <ben.howard@canonical.com>2014-01-17 08:27:09 -0700
committerBen Howard <ben.howard@canonical.com>2014-01-17 08:27:09 -0700
commit91d15b934b655fc56af416309ee020caac24ca3f (patch)
treedd5e25e073fa4b362950de6f40d2629332b9d714
parent13d9bf99ee49e2b72cfe63ee9d90c231890e292a (diff)
downloadvyos-cloud-init-91d15b934b655fc56af416309ee020caac24ca3f.tar.gz
vyos-cloud-init-91d15b934b655fc56af416309ee020caac24ca3f.zip
pep8 and pylint fixes; typo fix for documentation
-rw-r--r--cloudinit/stages.py11
-rw-r--r--doc/vendordata.txt2
-rw-r--r--tests/unittests/test_data.py4
3 files changed, 7 insertions, 10 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index 5dced998..8ae0bc0d 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -26,8 +26,7 @@ import copy
import os
import sys
-from cloudinit.settings import (PER_ALWAYS, PER_INSTANCE, FREQUENCIES,
- CLOUD_CONFIG)
+from cloudinit.settings import (PER_INSTANCE, FREQUENCIES, CLOUD_CONFIG)
from cloudinit import handlers
@@ -510,13 +509,13 @@ class Init(object):
vdcfg = {'enabled': False}
LOG.warn("invalid 'vendor_data' setting. resetting to: %s", vdcfg)
- if not util.is_true(vdcfg.get('enabled')):
- LOG.debug("vendordata consumption is disabled.")
- return
-
enabled = vdcfg.get('enabled')
no_handlers = vdcfg.get('disabled_handlers', None)
+ if not util.is_true(enabled):
+ LOG.debug("vendordata consumption is disabled.")
+ return
+
LOG.debug("vendor data will be consumed. disabled_handlers=%s",
no_handlers)
diff --git a/doc/vendordata.txt b/doc/vendordata.txt
index 63a6c999..530e3b4c 100644
--- a/doc/vendordata.txt
+++ b/doc/vendordata.txt
@@ -20,7 +20,7 @@ user can accidently override choices.
Further, we strongly advise vendors to not 'be evil'. By evil, we
mean any action that could compromise a system. Since users trust
you, please take care to make sure that any vendordata is safe,
-atomic, indopenant and does not put your users at risk.
+atomic, idempotent and does not put your users at risk.
cloud-init can read this input and act on it in different ways.
diff --git a/tests/unittests/test_data.py b/tests/unittests/test_data.py
index a753debf..68729c57 100644
--- a/tests/unittests/test_data.py
+++ b/tests/unittests/test_data.py
@@ -264,13 +264,11 @@ vendor_data:
freq=PER_INSTANCE)
mods = stages.Modules(initer)
(_which_ran, _failures) = mods.run_section('cloud_init_modules')
- cfg = mods.cfg
+ _cfg = mods.cfg
vendor_script = initer.paths.get_ipath_cur('vendor_scripts')
vendor_script_fns = "%s%s/part-001" % (new_root, vendor_script)
self.assertTrue(os.path.exists(vendor_script_fns))
-
-
def test_merging_cloud_config(self):
blob = '''
#cloud-config