openstack image set can't reset min-disk and min-ram to 0

Bug #1719499 reported by shogoadachi on 2017-09-26
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
Undecided
shogoadachi

Bug Description

Description
===========
If I set min-disk or min-ram to a value greater than 0 with "openstack image set" command once, I can't reset them to 0 unless I recreate the image.
It's very inconvenient.

Steps to reproduce
==================
1. Create an image.
   #openstack image create --file <file> <image-name>
   +------------------+------------------------------------------------------+
   | Field | Value |
   +------------------+------------------------------------------------------+
  (snip)
   | min_disk | 0 |
   | min_ram | 0 |
  (snip)
   +------------------+------------------------------------------------------+
2. Update the image with "--min-disk 1" and "--min-ram 1".
   # openstack image set --min-disk 1 --min-ram 1 <image>
3. Show the image.
   # openstack image show <image>
   +------------------+------------------------------------------------------+
   | Field | Value |
   +------------------+------------------------------------------------------+
  (snip)
   | min_disk | 1 |
   | min_ram | 1 |
  (snip)
   +------------------+------------------------------------------------------+
4. Update the image with "--min-disk 0" and "--min-ram 0".
   # openstack image set --min-disk 0 --min-ram 0 <image>
5. Show the image.
   # openstack image show <image>
   +------------------+------------------------------------------------------+
   | Field | Value |
   +------------------+------------------------------------------------------+
  (snip)
   | min_disk | 1 |<--- min_disk wasn't changed
   | min_ram | 1 |<--- min_ram wasn't changed
  (snip)

Changed in python-openstackclient:
assignee: nobody → shogoadachi (shogoadachi)

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

Changed in python-openstackclient:
status: New → In Progress

Reviewed: https://review.openstack.org/507345
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=4464109c7754a9287f75ec2af84398700d1450e6
Submitter: Zuul
Branch: master

commit 4464109c7754a9287f75ec2af84398700d1450e6
Author: ShogoAdachi <email address hidden>
Date: Thu Sep 7 19:10:24 2017 +0900

    Accept 0 for --min-disk and --min-ram

    The current openstackclient implementation cannot accept 0
    for --min-disk and --min-ram with the "openstack image set" command.
    If theses options get set to 0, the option parser in openstackclient
    wrongly interprets 0 as no option value. The 0 is valid for these
    options if administrators want to make it the default(no minimum
    requirements).

    This patch fix the parser so that it avoids only 'None'.

    Change-Id: Ie8ee37484c02c26f54adc56263fcd167c0ce7eb3
    Closes-bug: #1719499

Changed in python-openstackclient:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-openstackclient 3.13.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers