summaryrefslogtreecommitdiff
path: root/openstackclient/image
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/image')
-rw-r--r--openstackclient/image/client.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/openstackclient/image/client.py b/openstackclient/image/client.py
index d56ca3b2..9edffded 100644
--- a/openstackclient/image/client.py
+++ b/openstackclient/image/client.py
@@ -23,6 +23,8 @@ from openstackclient.common import utils
LOG = logging.getLogger(__name__)
+DEFAULT_IMAGE_API_VERSION = '1'
+API_VERSION_OPTION = 'os_image_api_version'
API_NAME = "image"
API_VERSIONS = {
"1": "openstackclient.image.client.Client_v1",
@@ -48,6 +50,20 @@ def make_client(instance):
)
+def build_option_parser(parser):
+ """Hook to add global options"""
+ parser.add_argument(
+ '--os-image-api-version',
+ metavar='<image-api-version>',
+ default=utils.env(
+ 'OS_IMAGE_API_VERSION',
+ default=DEFAULT_IMAGE_API_VERSION),
+ help='Image API version, default=' +
+ DEFAULT_IMAGE_API_VERSION +
+ ' (Env: OS_IMAGE_API_VERSION)')
+ return parser
+
+
# NOTE(dtroyer): glanceclient.v1.image.ImageManager() doesn't have a find()
# method so add one here until the common client libs arrive
# A similar subclass will be required for v2