diff options
Diffstat (limited to 'openstackclient/volume')
| -rw-r--r-- | openstackclient/volume/client.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/openstackclient/volume/client.py b/openstackclient/volume/client.py index 626b23f1..e04e8cd7 100644 --- a/openstackclient/volume/client.py +++ b/openstackclient/volume/client.py @@ -20,6 +20,8 @@ from openstackclient.common import utils LOG = logging.getLogger(__name__) +DEFAULT_VOLUME_API_VERSION = '1' +API_VERSION_OPTION = 'os_volume_api_version' API_NAME = "volume" API_VERSIONS = { "1": "cinderclient.v1.client.Client" @@ -45,3 +47,17 @@ def make_client(instance): ) return client + + +def build_option_parser(parser): + """Hook to add global options""" + parser.add_argument( + '--os-volume-api-version', + metavar='<volume-api-version>', + default=utils.env( + 'OS_VOLUME_API_VERSION', + default=DEFAULT_VOLUME_API_VERSION), + help='Volume API version, default=' + + DEFAULT_VOLUME_API_VERSION + + ' (Env: OS_VOLUME_API_VERSION)') + return parser |
