Specifying API version in clouds.yaml doesn't always work

Bug #2043219 reported by David Comay
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
New
Undecided
Unassigned

Bug Description

I suspect this is user error but filing this since it seems to be a bug.

All all of our nodes support a Compute API of 2.90, I was hoping we could use `clouds.yaml` to indicate that to avoid needing to pass `--os-compute-api-version` on the command line.

However, using a `clouds.yaml` file of the form

clouds:
  mycloud:
    auth:
      .
      .
    compute_api_version: 2.90

doesn't seem to work in that if I try the command

    openstack --os-cloud mycloud server migrate --live-migration --host newhost --wait <uuid>

I get the error

    --os-compute-api-version 2.30 or greater is required when using --host

The code in question from MigrateServer's take_action() method,

            if (
                parsed_args.host and
                compute_client.api_version < api_versions.APIVersion('2.30')
            ):
                raise exceptions.CommandError(
                    '--os-compute-api-version 2.30 or greater is required '
                    'when using --host'
                )

If I actually specify this via the CLI, --os-compute-api-version 2.90, the command succeeds.

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.