Fix client API version to support Manila API

The Manila client's API version is now '2.5' so that it matches the
Manila server's API version.

The client also supports the Manila V2 Keystone endpoint such that it
will only communicate with the Manila V2 API.

Closes-bug: 1494360

Change-Id: I3d011046bbe4f9223d93341f3d3ac09074f52990
This commit is contained in:
cFouts
2015-09-10 10:59:23 -04:00
committed by Chuck Fouts
parent 66ef98d87f
commit 3cd57eb32e
6 changed files with 59 additions and 51 deletions

View File

@@ -28,6 +28,7 @@ from manilaclient import exceptions
def get_client_class(version): def get_client_class(version):
version_map = { version_map = {
'1': 'manilaclient.v1.client.Client', '1': 'manilaclient.v1.client.Client',
'2': 'manilaclient.v1.client.Client',
} }
try: try:
client_path = version_map[str(version)] client_path = version_map[str(version)]
@@ -45,4 +46,4 @@ def get_major_version(version):
def Client(version, *args, **kwargs): def Client(version, *args, **kwargs):
client_class = get_client_class(get_major_version(version)) client_class = get_client_class(get_major_version(version))
return client_class(version, *args, **kwargs) return client_class(*args, **kwargs)

View File

@@ -40,4 +40,7 @@ SNAPSHOT_SORT_KEY_VALUES = (
) )
EXPERIMENTAL_HTTP_HEADER = 'X-OpenStack-Manila-API-Experimental' EXPERIMENTAL_HTTP_HEADER = 'X-OpenStack-Manila-API-Experimental'
MAX_API_VERSION = '1.6' MAX_API_VERSION = '2.5'
V1_API_VERSION = '1.0'
V1_SERVICE_TYPE = 'share'
V2_SERVICE_TYPE = 'sharev2'

View File

@@ -38,11 +38,10 @@ from manilaclient import exceptions as exc
import manilaclient.extension import manilaclient.extension
from manilaclient.openstack.common import cliutils from manilaclient.openstack.common import cliutils
from manilaclient.v1 import shell as shell_v1 from manilaclient.v1 import shell as shell_v1
# from manilaclient.v2 import shell as shell_v2
DEFAULT_OS_SHARE_API_VERSION = constants.MAX_API_VERSION DEFAULT_OS_SHARE_API_VERSION = constants.MAX_API_VERSION
DEFAULT_MANILA_ENDPOINT_TYPE = 'publicURL' DEFAULT_MANILA_ENDPOINT_TYPE = 'publicURL'
DEFAULT_MANILA_SERVICE_TYPE = 'share' DEFAULT_MANILA_SERVICE_TYPE = constants.V2_SERVICE_TYPE
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@@ -295,7 +294,9 @@ class OpenStackManilaShell(object):
def _discover_via_contrib_path(self, version): def _discover_via_contrib_path(self, version):
module_path = os.path.dirname(os.path.abspath(__file__)) module_path = os.path.dirname(os.path.abspath(__file__))
version_str = "v%s" % version.split('.')[0] # NOTE(cfouts) - temporary change to maintain other clients that are
# hardcoded to use the v1/client.py
version_str = 'v1'
ext_path = os.path.join(module_path, version_str, 'contrib') ext_path = os.path.join(module_path, version_str, 'contrib')
ext_glob = os.path.join(ext_path, "*.py") ext_glob = os.path.join(ext_path, "*.py")
@@ -446,7 +447,8 @@ class OpenStackManilaShell(object):
http_log_debug=args.debug, http_log_debug=args.debug,
cacert=cacert, cacert=cacert,
use_keyring=os_cache, use_keyring=os_cache,
force_new_token=os_reset_cache) force_new_token=os_reset_cache,
api_version=options.os_share_api_version)
args.func(self.cs, args) args.func(self.cs, args)

View File

@@ -18,7 +18,7 @@ import manilaclient.v1.client
class ClientTest(utils.TestCase): class ClientTest(utils.TestCase):
def test_get_client_class_v1(self): def test_get_client_class_v1(self):
output = manilaclient.client.get_client_class('1') output = manilaclient.client.get_client_class('2')
self.assertEqual(output, manilaclient.v1.client.Client) self.assertEqual(output, manilaclient.v1.client.Client)
def test_get_client_class_unknown(self): def test_get_client_class_unknown(self):

View File

@@ -17,6 +17,7 @@ from keystoneclient.v2_0 import client as keystone_client_v2
from keystoneclient.v3 import client as keystone_client_v3 from keystoneclient.v3 import client as keystone_client_v3
import six import six
from manilaclient.common import constants
from manilaclient import exceptions from manilaclient import exceptions
from manilaclient import httpclient from manilaclient import httpclient
from manilaclient.v1 import limits from manilaclient.v1 import limits
@@ -59,16 +60,17 @@ class Client(object):
>>> client.shares.list() >>> client.shares.list()
... ...
""" """
def __init__(self, api_version, username=None, api_key=None, def __init__(self, username=None, api_key=None,
project_id=None, auth_url=None, insecure=False, timeout=None, project_id=None, auth_url=None, insecure=False, timeout=None,
tenant_id=None, project_name=None, region_name=None, tenant_id=None, project_name=None, region_name=None,
endpoint_type='publicURL', extensions=None, endpoint_type='publicURL', extensions=None,
service_type='share', service_name=None, retries=None, service_type=constants.V1_SERVICE_TYPE, service_name=None,
http_log_debug=False, input_auth_token=None, session=None, retries=None, http_log_debug=False, input_auth_token=None,
auth=None, cacert=None, service_catalog_url=None, session=None, auth=None, cacert=None,
user_agent='python-manilaclient', service_catalog_url=None, user_agent='python-manilaclient',
use_keyring=False, force_new_token=False, use_keyring=False, force_new_token=False,
cached_token_lifetime=300, **kwargs): cached_token_lifetime=300,
api_version=constants.V1_API_VERSION, **kwargs):
service_name = kwargs.get("share_service_name", service_name) service_name = kwargs.get("share_service_name", service_name)
def check_deprecated_arguments(): def check_deprecated_arguments():

View File

@@ -299,7 +299,7 @@ def do_quota_defaults(cs, args):
default=None, default=None,
help='Whether force update the quota even if the already used ' help='Whether force update the quota even if the already used '
'and reserved exceeds the new quota.') 'and reserved exceeds the new quota.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_quota_update(cs, args): def do_quota_update(cs, args):
"""Update the quotas for a tenant/user.""" """Update the quotas for a tenant/user."""
@@ -330,7 +330,7 @@ def do_quota_delete(cs, args):
'class_name', 'class_name',
metavar='<class>', metavar='<class>',
help='Name of quota class to list the quotas for.') help='Name of quota class to list the quotas for.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_quota_class_show(cs, args): def do_quota_class_show(cs, args):
"""List the quotas for a quota class.""" """List the quotas for a quota class."""
@@ -373,14 +373,14 @@ def do_quota_class_show(cs, args):
type=int, type=int,
default=None, default=None,
help='New value for the "share_networks" quota.') help='New value for the "share_networks" quota.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_quota_class_update(cs, args): def do_quota_class_update(cs, args):
"""Update the quotas for a quota class.""" """Update the quotas for a quota class."""
_quota_update(cs.quota_classes, args.class_name, args) _quota_update(cs.quota_classes, args.class_name, args)
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_absolute_limits(cs, args): def do_absolute_limits(cs, args):
"""Print a list of absolute limits for a user.""" """Print a list of absolute limits for a user."""
limits = cs.limits.get().absolute limits = cs.limits.get().absolute
@@ -388,7 +388,7 @@ def do_absolute_limits(cs, args):
cliutils.print_list(limits, columns) cliutils.print_list(limits, columns)
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_rate_limits(cs, args): def do_rate_limits(cs, args):
"""Print a list of rate limits for a user.""" """Print a list of rate limits for a user."""
limits = cs.limits.get().rate limits = cs.limits.get().rate
@@ -453,7 +453,7 @@ def do_rate_limits(cs, args):
default=None, default=None,
action='single_alias', action='single_alias',
help='Availability zone in which share should be created.') help='Availability zone in which share should be created.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_create(cs, args): def do_create(cs, args):
"""Creates a new share (NFS, CIFS, GlusterFS or HDFS).""" """Creates a new share (NFS, CIFS, GlusterFS or HDFS)."""
@@ -483,7 +483,7 @@ def do_create(cs, args):
'force-migration, which bypasses driver ' 'force-migration, which bypasses driver '
'optimizations. Default=False.', 'optimizations. Default=False.',
default=False) default=False)
@cliutils.service_type('share') @cliutils.service_type('sharev2')
@api_versions.experimental_api @api_versions.experimental_api
def do_migrate(cs, args): def do_migrate(cs, args):
"""Migrates share to a new host.""" """Migrates share to a new host."""
@@ -506,7 +506,7 @@ def do_migrate(cs, args):
nargs='+', nargs='+',
default=[], default=[],
help='Metadata to set or unset (key is only necessary on unset).') help='Metadata to set or unset (key is only necessary on unset).')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_metadata(cs, args): def do_metadata(cs, args):
"""Set or delete metadata on a share.""" """Set or delete metadata on a share."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
@@ -522,7 +522,7 @@ def do_metadata(cs, args):
'share', 'share',
metavar='<share>', metavar='<share>',
help='Name or ID of the share.') help='Name or ID of the share.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_metadata_show(cs, args): def do_metadata_show(cs, args):
"""Show metadata of given share.""" """Show metadata of given share."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
@@ -540,7 +540,7 @@ def do_metadata_show(cs, args):
nargs='+', nargs='+',
default=[], default=[],
help='Metadata entry or entries to update.') help='Metadata entry or entries to update.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_metadata_update_all(cs, args): def do_metadata_update_all(cs, args):
"""Update all metadata of a share.""" """Update all metadata of a share."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
@@ -659,7 +659,7 @@ def do_force_delete(cs, args):
'share', 'share',
metavar='<share>', metavar='<share>',
help='Name or ID of the NAS share.') help='Name or ID of the NAS share.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_show(cs, args): def do_show(cs, args):
"""Show details about a NAS share.""" """Show details about a NAS share."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
@@ -688,7 +688,7 @@ def do_show(cs, args):
choices=['rw', 'ro'], choices=['rw', 'ro'],
help='Share access level ("rw" and "ro" access levels are supported). ' help='Share access level ("rw" and "ro" access levels are supported). '
'Defaults to None.') 'Defaults to None.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_access_allow(cs, args): def do_access_allow(cs, args):
"""Allow access to the share.""" """Allow access to the share."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
@@ -704,7 +704,7 @@ def do_access_allow(cs, args):
'id', 'id',
metavar='<id>', metavar='<id>',
help='ID of the access rule to be deleted.') help='ID of the access rule to be deleted.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_access_deny(cs, args): def do_access_deny(cs, args):
"""Deny access to a share.""" """Deny access to a share."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
@@ -715,7 +715,7 @@ def do_access_deny(cs, args):
'share', 'share',
metavar='<share>', metavar='<share>',
help='Name or ID of the share.') help='Name or ID of the share.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_access_list(cs, args): def do_access_list(cs, args):
"""Show access list for share.""" """Show access list for share."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
@@ -846,7 +846,7 @@ def do_access_list(cs, args):
action='store_true', action='store_true',
default=False, default=False,
help="Add public shares from all tenants to result.") help="Add public shares from all tenants to result.")
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_list(cs, args): def do_list(cs, args):
"""List NAS shares with filters.""" """List NAS shares with filters."""
list_of_keys = [ list_of_keys = [
@@ -895,7 +895,7 @@ def do_list(cs, args):
default=None, default=None,
action='single_alias', action='single_alias',
help='Filter results by share ID.') help='Filter results by share ID.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_share_instance_list(cs, args): def do_share_instance_list(cs, args):
"""List share instances.""" """List share instances."""
share = _find_share(cs, args.share_id) if args.share_id else None share = _find_share(cs, args.share_id) if args.share_id else None
@@ -916,7 +916,7 @@ def do_share_instance_list(cs, args):
'instance', 'instance',
metavar='<instance>', metavar='<instance>',
help='Name or ID of the share instance.') help='Name or ID of the share instance.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_share_instance_show(cs, args): def do_share_instance_show(cs, args):
"""Show details about a share instance.""" """Show details about a share instance."""
instance = _find_share_instance(cs, args.instance) instance = _find_share_instance(cs, args.instance)
@@ -954,7 +954,7 @@ def do_share_instance_force_delete(cs, args):
help=('Indicate which state to assign the instance. Options include ' help=('Indicate which state to assign the instance. Options include '
'available, error, creating, deleting, error_deleting. If no ' 'available, error, creating, deleting, error_deleting. If no '
'state is provided, available will be used.')) 'state is provided, available will be used.'))
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_share_instance_reset_state(cs, args): def do_share_instance_reset_state(cs, args):
"""Explicitly update the state of a share instance.""" """Explicitly update the state of a share instance."""
instance = _find_share_instance(cs, args.instance) instance = _find_share_instance(cs, args.instance)
@@ -1030,7 +1030,7 @@ def do_share_instance_reset_state(cs, args):
action='single_alias', action='single_alias',
help='Sort direction, available values are %(values)s. ' help='Sort direction, available values are %(values)s. '
'OPTIONAL: Default=None.' % {'values': constants.SORT_DIR_VALUES}) 'OPTIONAL: Default=None.' % {'values': constants.SORT_DIR_VALUES})
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_snapshot_list(cs, args): def do_snapshot_list(cs, args):
"""List all the snapshots.""" """List all the snapshots."""
list_of_keys = [ list_of_keys = [
@@ -1060,7 +1060,7 @@ def do_snapshot_list(cs, args):
'snapshot', 'snapshot',
metavar='<snapshot>', metavar='<snapshot>',
help='Name or ID of the snapshot.') help='Name or ID of the snapshot.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_snapshot_show(cs, args): def do_snapshot_show(cs, args):
"""Show details about a snapshot.""" """Show details about a snapshot."""
snapshot = _find_share_snapshot(cs, args.snapshot) snapshot = _find_share_snapshot(cs, args.snapshot)
@@ -1088,7 +1088,7 @@ def do_snapshot_show(cs, args):
metavar='<description>', metavar='<description>',
default=None, default=None,
help='Optional snapshot description. (Default=None)') help='Optional snapshot description. (Default=None)')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_snapshot_create(cs, args): def do_snapshot_create(cs, args):
"""Add a new snapshot.""" """Add a new snapshot."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
@@ -1121,7 +1121,7 @@ def do_snapshot_create(cs, args):
type=str, type=str,
action="single_alias", action="single_alias",
help='Public share is visible for all tenants.') help='Public share is visible for all tenants.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_update(cs, args): def do_update(cs, args):
"""Rename a share.""" """Rename a share."""
kwargs = {} kwargs = {}
@@ -1153,7 +1153,7 @@ def do_update(cs, args):
metavar='<description>', metavar='<description>',
help='Optional snapshot description. (Default=None)', help='Optional snapshot description. (Default=None)',
default=None) default=None)
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_snapshot_rename(cs, args): def do_snapshot_rename(cs, args):
"""Rename a snapshot.""" """Rename a snapshot."""
kwargs = {} kwargs = {}
@@ -1172,7 +1172,7 @@ def do_snapshot_rename(cs, args):
'snapshot', 'snapshot',
metavar='<snapshot>', metavar='<snapshot>',
help='Name or ID of the snapshot to delete.') help='Name or ID of the snapshot to delete.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_snapshot_delete(cs, args): def do_snapshot_delete(cs, args):
"""Remove a snapshot.""" """Remove a snapshot."""
snapshot = _find_share_snapshot(cs, args.snapshot) snapshot = _find_share_snapshot(cs, args.snapshot)
@@ -1183,7 +1183,7 @@ def do_snapshot_delete(cs, args):
'snapshot', 'snapshot',
metavar='<snapshot>', metavar='<snapshot>',
help='Name or ID of the snapshot to force delete.') help='Name or ID of the snapshot to force delete.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_snapshot_force_delete(cs, args): def do_snapshot_force_delete(cs, args):
"""Attempt force-delete of snapshot, regardless of state.""" """Attempt force-delete of snapshot, regardless of state."""
snapshot = _find_share_snapshot(cs, args.snapshot) snapshot = _find_share_snapshot(cs, args.snapshot)
@@ -1202,7 +1202,7 @@ def do_snapshot_force_delete(cs, args):
'Options include available, error, creating, deleting, ' 'Options include available, error, creating, deleting, '
'error_deleting. If no state is provided, ' 'error_deleting. If no state is provided, '
'available will be used.')) 'available will be used.'))
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_snapshot_reset_state(cs, args): def do_snapshot_reset_state(cs, args):
"""Explicitly update the state of a snapshot.""" """Explicitly update the state of a snapshot."""
snapshot = _find_share_snapshot(cs, args.snapshot) snapshot = _find_share_snapshot(cs, args.snapshot)
@@ -1220,7 +1220,7 @@ def do_snapshot_reset_state(cs, args):
help=('Indicate which state to assign the share. Options include ' help=('Indicate which state to assign the share. Options include '
'available, error, creating, deleting, error_deleting. If no ' 'available, error, creating, deleting, error_deleting. If no '
'state is provided, available will be used.')) 'state is provided, available will be used.'))
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_reset_state(cs, args): def do_reset_state(cs, args):
"""Explicitly update the state of a share.""" """Explicitly update the state of a share."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
@@ -1940,7 +1940,7 @@ def _find_share_type(cs, stype):
return apiclient_utils.find_resource(cs.share_types, stype) return apiclient_utils.find_resource(cs.share_types, stype)
@cliutils.service_type('share') @cliutils.service_type('sharev2')
@cliutils.arg( @cliutils.arg(
'--all', '--all',
dest='all', dest='all',
@@ -1958,7 +1958,7 @@ def do_type_list(cs, args):
_print_share_type_list(stypes, default_share_type=default) _print_share_type_list(stypes, default_share_type=default)
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_extra_specs_list(cs, args): def do_extra_specs_list(cs, args):
"""Print a list of current 'share types and extra specs' (Admin Only).""" """Print a list of current 'share types and extra specs' (Admin Only)."""
stypes = cs.share_types.list() stypes = cs.share_types.list()
@@ -1988,7 +1988,7 @@ def do_extra_specs_list(cs, args):
metavar='<is_public>', metavar='<is_public>',
action='single_alias', action='single_alias',
help="Make type accessible to the public (default true).") help="Make type accessible to the public (default true).")
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_type_create(cs, args): def do_type_create(cs, args):
"""Create a new share type.""" """Create a new share type."""
kwargs = { kwargs = {
@@ -2020,7 +2020,7 @@ def do_type_create(cs, args):
'id', 'id',
metavar='<id>', metavar='<id>',
help="Name or ID of the share type to delete.") help="Name or ID of the share type to delete.")
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_type_delete(cs, args): def do_type_delete(cs, args):
"""Delete a specific share type.""" """Delete a specific share type."""
share_type = _find_share_type(cs, args.id) share_type = _find_share_type(cs, args.id)
@@ -2042,7 +2042,7 @@ def do_type_delete(cs, args):
nargs='*', nargs='*',
default=None, default=None,
help='Extra_specs to set or unset (key is only necessary on unset).') help='Extra_specs to set or unset (key is only necessary on unset).')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_type_key(cs, args): def do_type_key(cs, args):
"""Set or unset extra_spec for a share type.""" """Set or unset extra_spec for a share type."""
stype = _find_share_type(cs, args.stype) stype = _find_share_type(cs, args.stype)
@@ -2074,7 +2074,7 @@ def do_type_key(cs, args):
type=str, type=str,
default='.*', default='.*',
help='Filter results by pool name. Regular expressions are supported.') help='Filter results by pool name. Regular expressions are supported.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_pool_list(cs, args): def do_pool_list(cs, args):
"""List all backend storage pools known to the scheduler (Admin only).""" """List all backend storage pools known to the scheduler (Admin only)."""
@@ -2092,7 +2092,7 @@ def do_pool_list(cs, args):
'share_type', 'share_type',
metavar='<share_type>', metavar='<share_type>',
help="Filter results by share type name or ID.") help="Filter results by share type name or ID.")
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_type_access_list(cs, args): def do_type_access_list(cs, args):
"""Print access information about the given share type.""" """Print access information about the given share type."""
share_type = _find_share_type(cs, args.share_type) share_type = _find_share_type(cs, args.share_type)
@@ -2114,7 +2114,7 @@ def do_type_access_list(cs, args):
'project_id', 'project_id',
metavar='<project_id>', metavar='<project_id>',
help='Project ID to add share type access for.') help='Project ID to add share type access for.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_type_access_add(cs, args): def do_type_access_add(cs, args):
"""Adds share type access for the given project.""" """Adds share type access for the given project."""
vtype = _find_share_type(cs, args.share_type) vtype = _find_share_type(cs, args.share_type)
@@ -2130,7 +2130,7 @@ def do_type_access_add(cs, args):
'project_id', 'project_id',
metavar='<project_id>', metavar='<project_id>',
help='Project ID to remove share type access for.') help='Project ID to remove share type access for.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_type_access_remove(cs, args): def do_type_access_remove(cs, args):
"""Removes share type access for the given project.""" """Removes share type access for the given project."""
vtype = _find_share_type(cs, args.share_type) vtype = _find_share_type(cs, args.share_type)
@@ -2144,7 +2144,7 @@ def do_type_access_remove(cs, args):
metavar='<new_size>', metavar='<new_size>',
type=int, type=int,
help='New size of share, in GBs.') help='New size of share, in GBs.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_extend(cs, args): def do_extend(cs, args):
"""Increases the size of an existing share.""" """Increases the size of an existing share."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)
@@ -2157,7 +2157,7 @@ def do_extend(cs, args):
metavar='<new_size>', metavar='<new_size>',
type=int, type=int,
help='New size of share, in GBs.') help='New size of share, in GBs.')
@cliutils.service_type('share') @cliutils.service_type('sharev2')
def do_shrink(cs, args): def do_shrink(cs, args):
"""Decreases the size of an existing share.""" """Decreases the size of an existing share."""
share = _find_share(cs, args.share) share = _find_share(cs, args.share)