summaryrefslogtreecommitdiff
path: root/bin/cloud-init
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-03-04 01:45:58 -0500
committerScott Moser <smoser@ubuntu.com>2016-03-04 01:45:58 -0500
commit8092805079d011093724d87e9485e5bf79479a72 (patch)
tree22e58fc368bc1ec27f527c153b8fe6fe27de4997 /bin/cloud-init
parent3400f839651d308e495d1d8a1d7c1c2b463ad98b (diff)
parent63357ed731710b2418810535d9c991adbaea8dcb (diff)
downloadvyos-cloud-init-8092805079d011093724d87e9485e5bf79479a72.tar.gz
vyos-cloud-init-8092805079d011093724d87e9485e5bf79479a72.zip
Apply pep8, pyflakes fixes for python2 and 3
Update make check target to run pep8 and run pyflakes or pyflakes3 depending on the value of 'PYVER'. This way the python3 build environment does not need python2 and vice versa. Also have make check run the 'yaml' test. tox: have tox run pep8 in the pyflakes
Diffstat (limited to 'bin/cloud-init')
-rwxr-xr-xbin/cloud-init43
1 files changed, 22 insertions, 21 deletions
diff --git a/bin/cloud-init b/bin/cloud-init
index 9b90c45e..7f665e7e 100755
--- a/bin/cloud-init
+++ b/bin/cloud-init
@@ -194,7 +194,7 @@ def main_init(name, args):
if args.debug:
# Reset so that all the debug handlers are closed out
LOG.debug(("Logging being reset, this logger may no"
- " longer be active shortly"))
+ " longer be active shortly"))
logging.resetLogging()
logging.setupLogging(init.cfg)
apply_reporting_cfg(init.cfg)
@@ -276,9 +276,9 @@ def main_init(name, args):
# This may run user-data handlers and/or perform
# url downloads and such as needed.
(ran, _results) = init.cloudify().run('consume_data',
- init.consume_data,
- args=[PER_INSTANCE],
- freq=PER_INSTANCE)
+ init.consume_data,
+ args=[PER_INSTANCE],
+ freq=PER_INSTANCE)
if not ran:
# Just consume anything that is set to run per-always
# if nothing ran in the per-instance code
@@ -349,7 +349,7 @@ def main_modules(action_name, args):
if args.debug:
# Reset so that all the debug handlers are closed out
LOG.debug(("Logging being reset, this logger may no"
- " longer be active shortly"))
+ " longer be active shortly"))
logging.resetLogging()
logging.setupLogging(mods.cfg)
apply_reporting_cfg(init.cfg)
@@ -534,7 +534,8 @@ def status_wrapper(name, args, data_d=None, link_d=None):
errors.extend(v1[m].get('errors', []))
atomic_write_json(result_path,
- {'v1': {'datasource': v1['datasource'], 'errors': errors}})
+ {'v1': {'datasource': v1['datasource'],
+ 'errors': errors}})
util.sym_link(os.path.relpath(result_path, link_d), result_link,
force=True)
@@ -578,13 +579,13 @@ def main():
# These settings are used for the 'config' and 'final' stages
parser_mod = subparsers.add_parser('modules',
- help=('activates modules '
- 'using a given configuration key'))
+ help=('activates modules using '
+ 'a given configuration key'))
parser_mod.add_argument("--mode", '-m', action='store',
- help=("module configuration name "
- "to use (default: %(default)s)"),
- default='config',
- choices=('init', 'config', 'final'))
+ help=("module configuration name "
+ "to use (default: %(default)s)"),
+ default='config',
+ choices=('init', 'config', 'final'))
parser_mod.set_defaults(action=('modules', main_modules))
# These settings are used when you want to query information
@@ -600,22 +601,22 @@ def main():
# This subcommand allows you to run a single module
parser_single = subparsers.add_parser('single',
- help=('run a single module '))
+ help=('run a single module '))
parser_single.set_defaults(action=('single', main_single))
parser_single.add_argument("--name", '-n', action="store",
- help="module name to run",
- required=True)
+ help="module name to run",
+ required=True)
parser_single.add_argument("--frequency", action="store",
- help=("frequency of the module"),
- required=False,
- choices=list(FREQ_SHORT_NAMES.keys()))
+ help=("frequency of the module"),
+ required=False,
+ choices=list(FREQ_SHORT_NAMES.keys()))
parser_single.add_argument("--report", action="store_true",
help="enable reporting",
required=False)
parser_single.add_argument("module_args", nargs="*",
- metavar='argument',
- help=('any additional arguments to'
- ' pass to this module'))
+ metavar='argument',
+ help=('any additional arguments to'
+ ' pass to this module'))
parser_single.set_defaults(action=('single', main_single))
args = parser.parse_args()