CLI: cloud-init modules -h documents unsupported --mode init

Bug #1736600 reported by Chad Smith on 2017-12-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Low
Chad Smith

Bug Description

sudo python3 -m cloudinit.cmd.main modules -h
[sudo] password for csmith:
usage: /home/csmith/src/cloud-init/cloudinit/cmd/main.py modules
       [-h] [--mode {init,config,final}]

optional arguments:
  -h, --help show this help message and exit
  --mode {init,config,final}, -m {init,config,final}
                        module configuration name to use (default: config)
csmith@uptown:~/src/cloud-init (master)$ sudo python3 -m cloudinit.cmd.main modules --mode init
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/csmith/src/cloud-init/cloudinit/cmd/main.py", line 835, in <module>
    main(sys.argv)
  File "/home/csmith/src/cloud-init/cloudinit/cmd/main.py", line 829, in main
    get_uptime=True, func=functor, args=(name, args))
  File "/home/csmith/src/cloud-init/cloudinit/util.py", line 2238, in log_time
    ret = func(*args, **kwargs)
  File "/home/csmith/src/cloud-init/cloudinit/cmd/main.py", line 631, in status_wrapper
    v1[mode]['start'] = time.time()
KeyError: 'modules-init'

We need to limit options to those listed in
cloudinit.cmd.main line 606:
   modes = ('init', 'init-local', 'modules-config', 'modules-final')

Related branches

Chad Smith (chad.smith) on 2017-12-14
summary: - cloud-init modules -h documents unsupported --mode init
+ CLI: cloud-init modules -h documents unsupported --mode init-
summary: - CLI: cloud-init modules -h documents unsupported --mode init-
+ CLI: cloud-init modules -h documents unsupported --mode init
Changed in cloud-init:
status: Triaged → In Progress
Chad Smith (chad.smith) on 2017-12-15
Changed in cloud-init:
status: In Progress → Fix Committed

This bug is believed to be fixed in cloud-init in 18.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers