flavor is not specified as required option for boot command

Bug #1502866 reported by Ravi Shekhar Jethani
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Low
Ravi Shekhar Jethani

Bug Description

For boot command flavor option is mandatory. This is not specified while adding the '--flavor' option using cliutils.arg decorator for do_boot method:

'do_boot' method : https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/shell.py#L329

@cliutils.arg(
    '--flavor',
    default=None,
    metavar='<flavor>',
    help=_("Name or ID of flavor (see 'nova flavor-list')."))

Rather this 'flavor required' criteria is being fulfilled later in the _boot method via an if condition. Also we are running image checks even before checking for flavor option. If user doesn't specify flavor then this image check is a waste.

'_boot' method : https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/shell.py#L151

if not args.flavor:
    raise exceptions.CommandError(_("you need to specify a Flavor ID "))

Changed in python-novaclient:
assignee: nobody → Ravi Shekhar Jethani (ravishekar-jethani)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/230965

Changed in python-novaclient:
status: New → In Progress
melanie witt (melwitt)
Changed in python-novaclient:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/230965
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=c6a3c766ee336a6ba873b041a5ec5711a20a911a
Submitter: Jenkins
Branch: master

commit c6a3c766ee336a6ba873b041a5ec5711a20a911a
Author: Ravi Shekhar Jethani <email address hidden>
Date: Tue Sep 29 23:58:09 2015 -0700

    Check flavor option before image checks

    Currently flavor option is checked after performing the image checks
    which results in unnecessary image checks even if flavor option is
    not passed at all. Moved flavor option check at the beginning of the
    method to eliminate the expensive operations performed as part of
    image check.

    Closes-Bug: #1502866
    Change-Id: Ic68690b3d985d78ba0312bf5421989ccba7ceea8

Changed in python-novaclient:
status: In Progress → Fix Committed
Changed in python-novaclient:
milestone: none → 2.35.0
status: Fix Committed → Fix Released
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.