Browse Source

[goal] Migrate testing to ubuntu focal

As per victoria cycle testing runtime and community goal[1]
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Fixing:
- bug#1886298
Bump the lower constraints for required deps which added python3.8
support in their later version.

- noqa for pep8 F811 check.

Closes-Bug: #1886298

Story: #2007865
Task: #40194

[1] https://governance.openstack.org/tc/goals/selected/victoria/migrate-ci-cd-jobs-to-ubuntu-focal

Change-Id: Id8300f4dbde7e59b8d6275b0671328e35670312c
changes/40/743140/4
Ghanshyam Mann 5 months ago
parent
commit
a68aaab172
17 changed files with 79 additions and 79 deletions
  1. +4
    -4
      lower-constraints.txt
  2. +1
    -1
      manilaclient/v2/availability_zones.py
  3. +3
    -3
      manilaclient/v2/quota_classes.py
  4. +10
    -10
      manilaclient/v2/quotas.py
  5. +3
    -3
      manilaclient/v2/services.py
  6. +6
    -6
      manilaclient/v2/share_group_snapshots.py
  7. +3
    -3
      manilaclient/v2/share_group_type_access.py
  8. +4
    -4
      manilaclient/v2/share_group_types.py
  9. +6
    -6
      manilaclient/v2/share_groups.py
  10. +3
    -3
      manilaclient/v2/share_instances.py
  11. +3
    -3
      manilaclient/v2/share_networks.py
  12. +1
    -1
      manilaclient/v2/share_servers.py
  13. +2
    -2
      manilaclient/v2/share_snapshots.py
  14. +1
    -1
      manilaclient/v2/share_type_access.py
  15. +3
    -3
      manilaclient/v2/share_types.py
  16. +15
    -15
      manilaclient/v2/shares.py
  17. +11
    -11
      manilaclient/v2/shell.py

+ 4
- 4
lower-constraints.txt View File

@ -2,11 +2,11 @@ alabaster==0.7.10
appdirs==1.3.0
asn1crypto==0.23.0
Babel==2.3.4
cffi==1.7.0
cffi==1.14.0
cliff==2.8.0
cmd2==0.8.0
coverage==4.0
cryptography==2.1
cryptography==2.7
ddt==1.0.1
debtcollector==1.2.0
decorator==3.4.0
@ -29,7 +29,7 @@ jsonpointer==1.13
jsonschema==2.6.0
keystoneauth1==3.4.0
linecache2==1.0.0
MarkupSafe==1.0
MarkupSafe==1.1.1
monotonic==0.6
msgpack-python==0.4.0
munch==2.1.0
@ -67,7 +67,7 @@ python-novaclient==9.1.0
python-openstackclient==3.12.0
python-subunit==1.0.0
pytz==2013.6
PyYAML==3.12
PyYAML==3.13
requests==2.14.2
requestsexceptions==1.2.0
rfc3986==0.3.1


+ 1
- 1
manilaclient/v2/availability_zones.py View File

@ -37,5 +37,5 @@ class AvailabilityZoneManager(base.Manager):
return self._list(RESOURCE_PATH_LEGACY, RESOURCE_NAME)
@api_versions.wraps("2.7") # noqa
def list(self):
def list(self): # noqa
return self._list(RESOURCE_PATH, RESOURCE_NAME)

+ 3
- 3
manilaclient/v2/quota_classes.py View File

@ -45,7 +45,7 @@ class QuotaClassSetManager(base.ManagerWithFind):
"quota_class_set")
@api_versions.wraps("2.7") # noqa
def get(self, class_name):
def get(self, class_name): # noqa
return self._get(
"%(resource_path)s/%(class_name)s" % {
"resource_path": RESOURCE_PATH, "class_name": class_name},
@ -87,7 +87,7 @@ class QuotaClassSetManager(base.ManagerWithFind):
share_networks=share_networks, resource_path=RESOURCE_PATH_LEGACY)
@api_versions.wraps("2.7", "2.52") # noqa
def update(self, class_name, shares=None, gigabytes=None,
def update(self, class_name, shares=None, gigabytes=None, # noqa
snapshots=None, snapshot_gigabytes=None, share_networks=None):
return self._do_update(
class_name, shares=shares, gigabytes=gigabytes,
@ -95,7 +95,7 @@ class QuotaClassSetManager(base.ManagerWithFind):
share_networks=share_networks, resource_path=RESOURCE_PATH)
@api_versions.wraps(REPLICA_QUOTAS_MICROVERSION) # noqa
def update(self, class_name, shares=None, gigabytes=None,
def update(self, class_name, shares=None, gigabytes=None, # noqa
snapshots=None, snapshot_gigabytes=None, share_networks=None,
share_replicas=None, replica_gigabytes=None):
return self._do_update(


+ 10
- 10
manilaclient/v2/quotas.py View File

@ -74,17 +74,17 @@ class QuotaSetManager(base.ManagerWithFind):
resource_path=RESOURCE_PATH_LEGACY)
@api_versions.wraps("2.7", "2.24") # noqa
def get(self, tenant_id, user_id=None, detail=False):
def get(self, tenant_id, user_id=None, detail=False): # noqa
return self._do_get(tenant_id, user_id,
resource_path=RESOURCE_PATH)
@api_versions.wraps("2.25", "2.38") # noqa
def get(self, tenant_id, user_id=None, detail=False):
def get(self, tenant_id, user_id=None, detail=False): # noqa
return self._do_get(tenant_id, user_id, detail=detail,
resource_path=RESOURCE_PATH)
@api_versions.wraps("2.39") # noqa
def get(self, tenant_id, user_id=None, share_type=None, detail=False):
def get(self, tenant_id, user_id=None, share_type=None, detail=False): # noqa
return self._do_get(
tenant_id, user_id, share_type=share_type, detail=detail,
resource_path=RESOURCE_PATH)
@ -141,7 +141,7 @@ class QuotaSetManager(base.ManagerWithFind):
)
@api_versions.wraps("2.7", "2.38") # noqa
def update(self, tenant_id, shares=None, snapshots=None, gigabytes=None,
def update(self, tenant_id, shares=None, snapshots=None, gigabytes=None, # noqa
snapshot_gigabytes=None, share_networks=None, force=None,
user_id=None):
return self._do_update(
@ -156,7 +156,7 @@ class QuotaSetManager(base.ManagerWithFind):
"not share type.")
@api_versions.wraps("2.39", "2.39") # noqa
def update(self, tenant_id, user_id=None, share_type=None,
def update(self, tenant_id, user_id=None, share_type=None, # noqa
shares=None, snapshots=None, gigabytes=None,
snapshot_gigabytes=None, share_networks=None, force=None):
self._validate_st_and_sn_in_same_request(share_type, share_networks)
@ -168,7 +168,7 @@ class QuotaSetManager(base.ManagerWithFind):
)
@api_versions.wraps("2.40", "2.52") # noqa
def update(self, tenant_id, user_id=None, share_type=None,
def update(self, tenant_id, user_id=None, share_type=None, # noqa
shares=None, snapshots=None, gigabytes=None,
snapshot_gigabytes=None, share_networks=None,
share_groups=None, share_group_snapshots=None,
@ -184,7 +184,7 @@ class QuotaSetManager(base.ManagerWithFind):
)
@api_versions.wraps(REPLICA_QUOTAS_MICROVERSION) # noqa
def update(self, tenant_id, user_id=None, share_type=None,
def update(self, tenant_id, user_id=None, share_type=None, # noqa
shares=None, snapshots=None, gigabytes=None,
snapshot_gigabytes=None, share_networks=None,
share_groups=None, share_group_snapshots=None,
@ -209,7 +209,7 @@ class QuotaSetManager(base.ManagerWithFind):
"quota_set")
@api_versions.wraps("2.7") # noqa
def defaults(self, tenant_id):
def defaults(self, tenant_id): # noqa
return self._get(
"%(resource_path)s/%(tenant_id)s/defaults" % {
"resource_path": RESOURCE_PATH, "tenant_id": tenant_id},
@ -238,10 +238,10 @@ class QuotaSetManager(base.ManagerWithFind):
tenant_id, user_id, resource_path=RESOURCE_PATH_LEGACY)
@api_versions.wraps("2.7", "2.38") # noqa
def delete(self, tenant_id, user_id=None):
def delete(self, tenant_id, user_id=None): # noqa
return self._do_delete(tenant_id, user_id, resource_path=RESOURCE_PATH)
@api_versions.wraps("2.39") # noqa
def delete(self, tenant_id, user_id=None, share_type=None):
def delete(self, tenant_id, user_id=None, share_type=None): # noqa
return self._do_delete(
tenant_id, user_id, share_type, resource_path=RESOURCE_PATH)

+ 3
- 3
manilaclient/v2/services.py View File

@ -50,7 +50,7 @@ class ServiceManager(base.Manager):
search_opts=search_opts, resource_path=RESOURCE_PATH_LEGACY)
@api_versions.wraps("2.7") # noqa
def list(self, search_opts=None):
def list(self, search_opts=None): # noqa
return self._do_list(
search_opts=search_opts, resource_path=RESOURCE_PATH)
@ -64,7 +64,7 @@ class ServiceManager(base.Manager):
return self._do_enable(host, binary, RESOURCE_PATH_LEGACY)
@api_versions.wraps("2.7") # noqa
def enable(self, host, binary):
def enable(self, host, binary): # noqa
return self._do_enable(host, binary, RESOURCE_PATH)
def _do_disable(self, host, binary, resource_path=RESOURCE_PATH):
@ -77,7 +77,7 @@ class ServiceManager(base.Manager):
return self._do_disable(host, binary, RESOURCE_PATH_LEGACY)
@api_versions.wraps("2.7") # noqa
def disable(self, host, binary):
def disable(self, host, binary): # noqa
return self._do_disable(host, binary, RESOURCE_PATH)
def server_api_version(self, url_append=""):


+ 6
- 6
manilaclient/v2/share_group_snapshots.py View File

@ -76,7 +76,7 @@ class ShareGroupSnapshotManager(base.ManagerWithFind):
description)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def create(self, share_group, name=None, description=None):
def create(self, share_group, name=None, description=None): # noqa
return self._create_share_group_snapshot(share_group, name,
description)
@ -97,7 +97,7 @@ class ShareGroupSnapshotManager(base.ManagerWithFind):
return self._get_share_group_snapshot(share_group_snapshot)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def get(self, share_group_snapshot):
def get(self, share_group_snapshot): # noqa
return self._get_share_group_snapshot(share_group_snapshot)
def _list_share_group_snapshots(self, detailed=True, search_opts=None,
@ -154,7 +154,7 @@ class ShareGroupSnapshotManager(base.ManagerWithFind):
sort_key=sort_key, sort_dir=sort_dir)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def list(self, detailed=True, search_opts=None,
def list(self, detailed=True, search_opts=None, # noqa
sort_key=None, sort_dir=None):
return self._list_share_group_snapshots(
detailed=detailed, search_opts=search_opts,
@ -182,7 +182,7 @@ class ShareGroupSnapshotManager(base.ManagerWithFind):
**kwargs)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def update(self, share_group_snapshot, **kwargs):
def update(self, share_group_snapshot, **kwargs): # noqa
return self._update_share_group_snapshot(share_group_snapshot,
**kwargs)
@ -208,7 +208,7 @@ class ShareGroupSnapshotManager(base.ManagerWithFind):
self._delete_share_group_snapshot(share_group_snapshot, force=force)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def delete(self, share_group_snapshot, force=False):
def delete(self, share_group_snapshot, force=False): # noqa
self._delete_share_group_snapshot(share_group_snapshot, force=force)
def _share_group_snapshot_reset_state(self, share_group_snapshot, state):
@ -229,5 +229,5 @@ class ShareGroupSnapshotManager(base.ManagerWithFind):
self._share_group_snapshot_reset_state(share_group_snapshot, state)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def reset_state(self, share_group_snapshot, state):
def reset_state(self, share_group_snapshot, state): # noqa
self._share_group_snapshot_reset_state(share_group_snapshot, state)

+ 3
- 3
manilaclient/v2/share_group_type_access.py View File

@ -48,7 +48,7 @@ class ShareGroupTypeAccessManager(base.ManagerWithFind):
search_opts)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def list(self, share_group_type, search_opts=None):
def list(self, share_group_type, search_opts=None): # noqa
return self._list_share_group_type_access(share_group_type,
search_opts)
@ -60,7 +60,7 @@ class ShareGroupTypeAccessManager(base.ManagerWithFind):
self._action('addProjectAccess', share_group_type, info)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def add_project_access(self, share_group_type, project):
def add_project_access(self, share_group_type, project): # noqa
"""Add a project to the given share group type access list."""
info = {'project': project}
self._action('addProjectAccess', share_group_type, info)
@ -73,7 +73,7 @@ class ShareGroupTypeAccessManager(base.ManagerWithFind):
self._action('removeProjectAccess', share_group_type, info)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def remove_project_access(self, share_group_type, project):
def remove_project_access(self, share_group_type, project): # noqa
"""Remove a project from the given share group type access list."""
info = {'project': project}
self._action('removeProjectAccess', share_group_type, info)


+ 4
- 4
manilaclient/v2/share_group_types.py View File

@ -123,7 +123,7 @@ class ShareGroupTypeManager(base.ManagerWithFind):
group_specs)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def create(self, name, share_types, is_public=False, group_specs=None):
def create(self, name, share_types, is_public=False, group_specs=None): # noqa
return self._create_share_group_type(name, share_types, is_public,
group_specs)
@ -144,7 +144,7 @@ class ShareGroupTypeManager(base.ManagerWithFind):
return self._get_share_group_type(share_group_type)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def get(self, share_group_type="default"):
def get(self, share_group_type="default"): # noqa
return self._get_share_group_type(share_group_type)
def _list_share_group_types(self, show_all=True, search_opts=None):
@ -162,7 +162,7 @@ class ShareGroupTypeManager(base.ManagerWithFind):
return self._list_share_group_types(show_all, search_opts)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def list(self, show_all=True, search_opts=None):
def list(self, show_all=True, search_opts=None): # noqa
return self._list_share_group_types(show_all, search_opts)
def _delete_share_group_type(self, share_group_type):
@ -181,5 +181,5 @@ class ShareGroupTypeManager(base.ManagerWithFind):
self._delete_share_group_type(share_group_type)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def delete(self, share_group_type):
def delete(self, share_group_type): # noqa
self._delete_share_group_type(share_group_type)

+ 6
- 6
manilaclient/v2/share_groups.py View File

@ -114,7 +114,7 @@ class ShareGroupManager(base.ManagerWithFind):
availability_zone=availability_zone)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def create(self, share_group_type=None, share_types=None,
def create(self, share_group_type=None, share_types=None, # noqa
share_network=None, name=None, description=None,
source_share_group_snapshot=None, availability_zone=None):
return self._create_share_group(
@ -139,7 +139,7 @@ class ShareGroupManager(base.ManagerWithFind):
return self._get_share_group(share_group)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def get(self, share_group):
def get(self, share_group): # noqa
return self._get_share_group(share_group)
def _list_share_groups(self, detailed=True, search_opts=None,
@ -205,7 +205,7 @@ class ShareGroupManager(base.ManagerWithFind):
sort_key=sort_key, sort_dir=sort_dir)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def list(self, detailed=True, search_opts=None,
def list(self, detailed=True, search_opts=None, # noqa
sort_key=None, sort_dir=None):
return self._list_share_groups(
detailed=detailed, search_opts=search_opts, sort_key=sort_key,
@ -230,7 +230,7 @@ class ShareGroupManager(base.ManagerWithFind):
return self._update_share_group(share_group, **kwargs)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def update(self, share_group, **kwargs):
def update(self, share_group, **kwargs): # noqa
return self._update_share_group(share_group, **kwargs)
def _delete_share_group(self, share_group, force=False):
@ -254,7 +254,7 @@ class ShareGroupManager(base.ManagerWithFind):
self._delete_share_group(share_group, force=force)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def delete(self, share_group, force=False):
def delete(self, share_group, force=False): # noqa
self._delete_share_group(share_group, force=force)
def _share_group_reset_state(self, share_group, state):
@ -275,5 +275,5 @@ class ShareGroupManager(base.ManagerWithFind):
self._share_group_reset_state(share_group, state)
@api_versions.wraps(SG_GRADUATION_VERSION) # noqa
def reset_state(self, share_group, state):
def reset_state(self, share_group, state): # noqa
self._share_group_reset_state(share_group, state)

+ 3
- 3
manilaclient/v2/share_instances.py View File

@ -54,7 +54,7 @@ class ShareInstanceManager(base.ManagerWithFind):
return self.do_list()
@api_versions.wraps("2.35") # noqa
def list(self, export_location=None, search_opts=None):
def list(self, export_location=None, search_opts=None): # noqa
"""List all share instances."""
return self.do_list(export_location)
@ -94,7 +94,7 @@ class ShareInstanceManager(base.ManagerWithFind):
return self._do_force_delete(instance, "os-force_delete")
@api_versions.wraps("2.7") # noqa
def force_delete(self, instance):
def force_delete(self, instance): # noqa
return self._do_force_delete(instance, "force_delete")
def _do_reset_state(self, instance, state, action_name):
@ -110,5 +110,5 @@ class ShareInstanceManager(base.ManagerWithFind):
return self._do_reset_state(instance, state, "os-reset_status")
@api_versions.wraps("2.7") # noqa
def reset_state(self, instance, state):
def reset_state(self, instance, state): # noqa
return self._do_reset_state(instance, state, "reset_status")

+ 3
- 3
manilaclient/v2/share_networks.py View File

@ -71,7 +71,7 @@ class ShareNetworkManager(base.ManagerWithFind):
return self._create(RESOURCES_PATH, body, RESOURCE_NAME)
@api_versions.wraps("2.26", "2.50") # noqa
def create(self, neutron_net_id=None, neutron_subnet_id=None,
def create(self, neutron_net_id=None, neutron_subnet_id=None, # noqa
name=None, description=None):
"""Create share network.
@ -96,7 +96,7 @@ class ShareNetworkManager(base.ManagerWithFind):
return self._create(RESOURCES_PATH, body, RESOURCE_NAME)
@api_versions.wraps("2.51") # noqa
def create(self, neutron_net_id=None, neutron_subnet_id=None,
def create(self, neutron_net_id=None, neutron_subnet_id=None, # noqa
name=None, description=None, availability_zone=None):
values = {}
@ -195,7 +195,7 @@ class ShareNetworkManager(base.ManagerWithFind):
RESOURCE_NAME)
@api_versions.wraps("2.26") # noqa
def update(self, share_network, neutron_net_id=None,
def update(self, share_network, neutron_net_id=None, # noqa
neutron_subnet_id=None, name=None,
description=None):
"""Updates a share network.


+ 1
- 1
manilaclient/v2/share_servers.py View File

@ -113,7 +113,7 @@ class ShareServerManager(base.ManagerWithFind):
'share_server')
@api_versions.wraps("2.51") # noqa
def manage(self, host, share_network_id, identifier,
def manage(self, host, share_network_id, identifier, # noqa
share_network_subnet_id=None, driver_options=None):
driver_options = driver_options or {}


+ 2
- 2
manilaclient/v2/share_snapshots.py View File

@ -172,7 +172,7 @@ class ShareSnapshotManager(base.ManagerWithFind):
return self._do_force_delete(snapshot, "os-force_delete")
@api_versions.wraps("2.7") # noqa
def force_delete(self, snapshot):
def force_delete(self, snapshot): # noqa
return self._do_force_delete(snapshot, "force_delete")
def update(self, snapshot, **kwargs):
@ -198,7 +198,7 @@ class ShareSnapshotManager(base.ManagerWithFind):
return self._do_reset_state(snapshot, state, "os-reset_status")
@api_versions.wraps("2.7") # noqa
def reset_state(self, snapshot, state):
def reset_state(self, snapshot, state): # noqa
return self._do_reset_state(snapshot, state, "reset_status")
def _do_allow(self, snapshot, access_type, access_to):


+ 1
- 1
manilaclient/v2/share_type_access.py View File

@ -44,7 +44,7 @@ class ShareTypeAccessManager(base.ManagerWithFind):
return self._do_list(share_type, "os-share-type-access")
@api_versions.wraps("2.7") # noqa
def list(self, share_type, search_opts=None):
def list(self, share_type, search_opts=None): # noqa
return self._do_list(share_type, "share_type_access")
def add_project_access(self, share_type, project):


+ 3
- 3
manilaclient/v2/share_types.py View File

@ -209,7 +209,7 @@ class ShareTypeManager(base.ManagerWithFind):
is_public_keyname="os-share-type-access:is_public")
@api_versions.wraps("2.7", "2.23") # noqa
def create(self, name, spec_driver_handles_share_servers,
def create(self, name, spec_driver_handles_share_servers, # noqa
spec_snapshot_support=None, is_public=True, extra_specs=None):
if extra_specs is None:
@ -223,7 +223,7 @@ class ShareTypeManager(base.ManagerWithFind):
return self._do_create(name, extra_specs, is_public)
@api_versions.wraps("2.24", "2.40") # noqa
def create(self, name, spec_driver_handles_share_servers,
def create(self, name, spec_driver_handles_share_servers, # noqa
spec_snapshot_support=None, is_public=True, extra_specs=None):
if extra_specs is None:
@ -236,7 +236,7 @@ class ShareTypeManager(base.ManagerWithFind):
return self._do_create(name, extra_specs, is_public)
@api_versions.wraps("2.41") # noqa
def create(self, name, spec_driver_handles_share_servers,
def create(self, name, spec_driver_handles_share_servers, # noqa
spec_snapshot_support=None, is_public=True, extra_specs=None,
description=None):
if extra_specs is None:


+ 15
- 15
manilaclient/v2/shares.py View File

@ -254,7 +254,7 @@ class ShareManager(base.ManagerWithFind):
resource_path="/os-share-manage")
@api_versions.wraps("2.7", "2.7") # noqa
def manage(self, service_host, protocol, export_path, driver_options=None,
def manage(self, service_host, protocol, export_path, driver_options=None, # noqa
share_type=None, name=None, description=None):
return self._do_manage(
service_host, protocol, export_path, driver_options=driver_options,
@ -262,7 +262,7 @@ class ShareManager(base.ManagerWithFind):
resource_path="/shares/manage")
@api_versions.wraps("2.8", "2.48") # noqa
def manage(self, service_host, protocol, export_path, driver_options=None,
def manage(self, service_host, protocol, export_path, driver_options=None, # noqa
share_type=None, name=None, description=None, is_public=False):
return self._do_manage(
service_host, protocol, export_path, driver_options=driver_options,
@ -270,7 +270,7 @@ class ShareManager(base.ManagerWithFind):
is_public=is_public, resource_path="/shares/manage")
@api_versions.wraps("2.49") # noqa
def manage(self, service_host, protocol, export_path, driver_options=None,
def manage(self, service_host, protocol, export_path, driver_options=None, # noqa
share_type=None, name=None, description=None, is_public=False,
share_server_id=None):
return self._do_manage(
@ -289,7 +289,7 @@ class ShareManager(base.ManagerWithFind):
"/os-share-unmanage/%s/unmanage" % common_base.getid(share))
@api_versions.wraps("2.7") # noqa
def unmanage(self, share):
def unmanage(self, share): # noqa
"""Unmanage a share.
:param share: either share object or text with its ID.
@ -341,7 +341,7 @@ class ShareManager(base.ManagerWithFind):
sort_key=sort_key, sort_dir=sort_dir)
@api_versions.wraps("2.35") # noqa
def list(self, detailed=True, search_opts=None,
def list(self, detailed=True, search_opts=None, # noqa
sort_key=None, sort_dir=None):
"""Get a list of all shares."""
return self.do_list(detailed=detailed, search_opts=search_opts,
@ -442,7 +442,7 @@ class ShareManager(base.ManagerWithFind):
return self._do_force_delete(share, "os-force_delete")
@api_versions.wraps("2.7") # noqa
def force_delete(self, share):
def force_delete(self, share): # noqa
return self._do_force_delete(share, "force_delete")
@staticmethod
@ -555,20 +555,20 @@ class ShareManager(base.ManagerWithFind):
share, access_type, access, access_level, "os-allow_access")
@api_versions.wraps("2.7", "2.12") # noqa
def allow(self, share, access_type, access, access_level, metadata=None):
def allow(self, share, access_type, access, access_level, metadata=None): # noqa
self._validate_access(access_type, access)
return self._do_allow(
share, access_type, access, access_level, "allow_access")
@api_versions.wraps("2.13", "2.37") # noqa
def allow(self, share, access_type, access, access_level, metadata=None):
def allow(self, share, access_type, access, access_level, metadata=None): # noqa
valid_access_types = ('ip', 'user', 'cert', 'cephx')
self._validate_access(access_type, access, valid_access_types)
return self._do_allow(
share, access_type, access, access_level, "allow_access")
@api_versions.wraps("2.38", "2.44") # noqa
def allow(self, share, access_type, access, access_level, metadata=None):
def allow(self, share, access_type, access, access_level, metadata=None): # noqa
valid_access_types = ('ip', 'user', 'cert', 'cephx')
self._validate_access(access_type, access, valid_access_types,
enable_ipv6=True)
@ -576,7 +576,7 @@ class ShareManager(base.ManagerWithFind):
share, access_type, access, access_level, "allow_access")
@api_versions.wraps("2.45") # noqa
def allow(self, share, access_type, access, access_level, metadata=None):
def allow(self, share, access_type, access, access_level, metadata=None): # noqa
valid_access_types = ('ip', 'user', 'cert', 'cephx')
self._validate_access(access_type, access, valid_access_types,
enable_ipv6=True)
@ -596,7 +596,7 @@ class ShareManager(base.ManagerWithFind):
return self._do_deny(share, access_id, "os-deny_access")
@api_versions.wraps("2.7") # noqa
def deny(self, share, access_id):
def deny(self, share, access_id): # noqa
return self._do_deny(share, access_id, "deny_access")
def _do_access_list(self, share, action_name):
@ -616,7 +616,7 @@ class ShareManager(base.ManagerWithFind):
return self._do_access_list(share, "os-access_list")
@api_versions.wraps("2.7", "2.44") # noqa
def access_list(self, share):
def access_list(self, share): # noqa
return self._do_access_list(share, "access_list")
def get_metadata(self, share):
@ -684,7 +684,7 @@ class ShareManager(base.ManagerWithFind):
return self._do_reset_state(share, state, "os-reset_status")
@api_versions.wraps("2.7") # noqa
def reset_state(self, share, state):
def reset_state(self, share, state): # noqa
return self._do_reset_state(share, state, "reset_status")
def _do_extend(self, share, new_size, action_name):
@ -700,7 +700,7 @@ class ShareManager(base.ManagerWithFind):
return self._do_extend(share, new_size, "os-extend")
@api_versions.wraps("2.7") # noqa
def extend(self, share, new_size):
def extend(self, share, new_size): # noqa
return self._do_extend(share, new_size, "extend")
def _do_shrink(self, share, new_size, action_name):
@ -716,7 +716,7 @@ class ShareManager(base.ManagerWithFind):
return self._do_shrink(share, new_size, "os-shrink")
@api_versions.wraps("2.7") # noqa
def shrink(self, share, new_size):
def shrink(self, share, new_size): # noqa
return self._do_shrink(share, new_size, "shrink")
def list_instances(self, share):


+ 11
- 11
manilaclient/v2/shell.py View File

@ -96,7 +96,7 @@ def _print_share(cs, share):
@api_versions.wraps("2.9") # noqa
def _print_share(cs, share):
def _print_share(cs, share): # noqa
info = share._info.copy()
info.pop('links', None)
@ -165,7 +165,7 @@ def _print_share_instance(cs, instance):
@api_versions.wraps("2.9") # noqa
def _print_share_instance(cs, instance):
def _print_share_instance(cs, instance): # noqa
info = instance._info.copy()
info.pop('links', None)
if info.get('export_locations'):
@ -188,7 +188,7 @@ def _print_share_replica(cs, replica):
@api_versions.wraps("2.47") # noqa
def _print_share_replica(cs, replica):
def _print_share_replica(cs, replica): # noqa
info = replica._info.copy()
info.pop('links', None)
if info.get('export_locations'):
@ -1446,7 +1446,7 @@ def do_show(cs, args):
'share',
metavar='<share>',
help='Name or ID of the NAS share.')
def do_show(cs, args):
def do_show(cs, args): # noqa
"""Show details about a NAS share."""
share = _find_share(cs, args.share)
export_locations = cs.share_export_locations.list(share)
@ -1644,7 +1644,7 @@ def do_access_list(cs, args):
default=None,
help='Comma separated list of columns to be displayed '
'example --columns "access_type,access_to".')
def do_access_list(cs, args):
def do_access_list(cs, args): # noqa
"""Show access list for share."""
list_of_keys = [
'id', 'access_type', 'access_to', 'access_level', 'state',
@ -1679,7 +1679,7 @@ def do_access_list(cs, args):
help='Filters results by a metadata key and value. OPTIONAL: '
'Default=None. Available only for microversion >= 2.45',
default=None)
def do_access_list(cs, args):
def do_access_list(cs, args): # noqa
"""Show access list for share."""
list_of_keys = [
'id', 'access_type', 'access_to', 'access_level', 'state',
@ -2073,7 +2073,7 @@ def do_share_instance_show(cs, args):
'instance',
metavar='<instance>',
help='Name or ID of the share instance.')
def do_share_instance_show(cs, args):
def do_share_instance_show(cs, args): # noqa
"""Show details about a share instance (Admin only)."""
instance = _find_share_instance(cs, args.instance)
export_locations = cs.share_instance_export_locations.list(instance)
@ -2758,7 +2758,7 @@ def do_share_network_create(cs, args):
"zones when the driver is operating with "
"'driver_handles_share_servers' extra_spec set to True. Available "
"only for microversion >= 2.51. (Default=None)")
def do_share_network_create(cs, args):
def do_share_network_create(cs, args): # noqa
"""Create a share network to export shares to."""
values = {
'neutron_net_id': args.neutron_net_id,
@ -2863,7 +2863,7 @@ def do_share_network_update(cs, args):
metavar='<description>',
default=None,
help="Share network description.")
def do_share_network_update(cs, args):
def do_share_network_update(cs, args): # noqa
"""Update share network data."""
values = {
@ -3170,7 +3170,7 @@ def do_share_network_list(cs, args):
default=None,
help='Filter results matching a share network description pattern. '
'Available only for microversion >= 2.36.')
def do_share_network_list(cs, args):
def do_share_network_list(cs, args): # noqa
"""Get a list of share networks"""
all_projects = int(
os.environ.get("ALL_TENANTS",
@ -5413,7 +5413,7 @@ def do_share_replica_show(cs, args):
'replica',
metavar='<replica>',
help='ID of the share replica.')
def do_share_replica_show(cs, args):
def do_share_replica_show(cs, args): # noqa
"""Show details about a replica (Experimental)."""
replica = cs.share_replicas.get(args.replica)


Loading…
Cancel
Save