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

Bug #1736600 reported by Chad Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
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)
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)
Changed in cloud-init:
status: In Progress → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Cloud-init 18.1

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
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.