--disk-format option to `openstack image create` fails on older version of python-openstackclient

Bug #1634045 reported by Dominique Poulain
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Charm Testing
New
Undecided
Unassigned

Bug Description

profiles/common includes a call to `openstack image create` like so:

openstack image show $image_name || {
        openstack image create --public \
            --container-format=bare --disk-format=$image_format \
            --file=${HOME}/images/$image_file $image_name \
            --property architecture=$image_arch \
            --property hypervisor_type=$image_hv_type
    }

(lines 22-28; erroring flag option at <http://bazaar.launchpad.net/~ost-maintainers/openstack-charm-testing/trunk/view/head:/profiles/common#L24>).

While --disk-format is valid syntax for python-openstackclient for 2.3.0 on Xenial, that is not the case for version 0.3.0, which is the one available for Trusty, and for which the option is spelt disk_format instead (underscore instead of dash).

Version tables:

$ rmadison python-openstackclient
 python-openstackclient | 0.3.0-1ubuntu1 | trusty/universe | source, all
 python-openstackclient | 1.0.1-0ubuntu1 | vivid/universe | source, all
 python-openstackclient | 1.0.3-0ubuntu1 | vivid-updates/universe | source, all
 python-openstackclient | 1.7.0-1 | wily | source, all
 python-openstackclient | 2.3.0-2 | xenial | source, all
 python-openstackclient | 3.2.0-0ubuntu2 | yakkety | source, all

On a 14.04.5 Trusty box:

$ apt-cache policy python-openstackclient
python-openstackclient:
  Installed: 0.3.0-1ubuntu1
  Candidate: 0.3.0-1ubuntu1
  Version table:
 *** 0.3.0-1ubuntu1 0
        500 http://nova.clouds.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
        100 /var/lib/dpkg/status

As a result, openstack errors out, and the configure script blows up:

+ openstack image create --public --container-format=bare --disk-format=qcow2 --file=/home/ubuntu/images/xenial-server-cloudimg-amd64-disk1.img xenial --property architecture=x86_64 --property hypervisor_type=qemu
INFO: urllib3.connectionpool Starting new HTTP connection (1): <REDACTED>
usage: openstack image create [-h] [-f {shell,table}] [-c COLUMN]
                              [--variable VARIABLE] [--prefix PREFIX]
                              [--disk_format <disk_format>] [--id <id>]
                              [--store <store>]
                              [--container-format <container_format>]
                              [--owner <project>] [--size <size>]
                              [--min-disk <disk_gb>] [--min-ram <disk_ram>]
                              [--location <image_url>] [--file <file>]
                              [--checksum <checksum>]
                              [--copy-from <image_url>]
                              [--property <key=value>]
                              [--protected | --unprotected]
                              [--public | --private]
                              <name>
openstack image create: error: unrecognized arguments: --disk-format=qcow2

Trusty/python-openstackclient 0.3.0:

openstack --version && openstack image create 2>&1 | grep disk_format
openstack 0.3.0
                              [--disk_format <disk_format>] [--id <id>]

As against Xenial/python-openstackclient 2.3.0:

$ openstack --version && openstack image create 2>&1 | grep disk-format
openstack 2.3.0
                              [--disk-format <disk-format>]

summary: --disk-format option to `openstack image create` fails on older version
- of python-openstack-client
+ of python-openstackclient
description: updated
description: updated
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.