Fix share network create command with the AZ option

Previously, "share network create" command was trying to look up
the availability-zone provided by the user. However, this is not supported
by the AvailabilityZoneManager.

Drop the AZ lookup if the option is used and pass the user provided value
to the API.

Closes-Bug: 1962288
Change-Id: I3ec926122eed932caebcb31b9afd0f811f1f3c8e
This commit is contained in:
hassanasghar 2022-04-07 19:26:01 +00:00 committed by Goutham Pacha Ravi
parent 08508e5c96
commit 1e37914502
2 changed files with 5 additions and 3 deletions

@ -295,9 +295,7 @@ class CreateShareNetwork(command.ShowOne):
"Availability zone can be specified only with manila API " "Availability zone can be specified only with manila API "
"version >= 2.51") "version >= 2.51")
elif parsed_args.availability_zone: elif parsed_args.availability_zone:
availability_zone = oscutils.find_resource( availability_zone = parsed_args.availability_zone
share_client.availability_zones,
parsed_args.availability_zone).name
share_network = share_client.share_networks.create( share_network = share_client.share_networks.create(
name=parsed_args.name, name=parsed_args.name,

@ -0,0 +1,4 @@
fixes:
- |
Fixed the use of the "--availability-zone" option with the
"openstack share network create" command.