summaryrefslogtreecommitdiff
path: root/glanceclient/v2/shell.py
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2015-08-06 00:19:48 +1000
committerFlavio Percoco <flaper87@gmail.com>2015-08-12 11:10:54 +0200
commit3949e0e918e2501c4953a7d9beb58511688d84e1 (patch)
tree30813b22d9f27dfcd7b1d7c19a80940687c2fefc /glanceclient/v2/shell.py
parent6d28b513e3d8586652dfef4aa32ab789bb9e5c2f (diff)
downloadpython-glanceclient-3949e0e918e2501c4953a7d9beb58511688d84e1.tar.gz
Ship the default image schema in the client
Now that we have stable branches for clients, it's easier to keep track of the current default image's schema in Glance and update it respectively. This patch adds the current image schema, including the schema-properties. One good reason to do this is to be able to react when a running Glance instance is not around to be introspected. It's really unfortunate that things like help text can't be rendered when there image schema is not available in the system. We could keep the schema in a json file but rather than shipping data files with glanceclient we can just have it in the python modules. Change-Id: I9b8cc1d18d6717ccf991fb8149ab13c06d653ee4 Closes-bug: #1481729
Diffstat (limited to 'glanceclient/v2/shell.py')
-rw-r--r--glanceclient/v2/shell.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/glanceclient/v2/shell.py b/glanceclient/v2/shell.py
index a56e552..65a0743 100644
--- a/glanceclient/v2/shell.py
+++ b/glanceclient/v2/shell.py
@@ -19,6 +19,7 @@ from glanceclient.common import progressbar
from glanceclient.common import utils
from glanceclient import exc
from glanceclient.v2 import image_members
+from glanceclient.v2 import image_schema
from glanceclient.v2 import images
from glanceclient.v2 import tasks
import json
@@ -36,6 +37,8 @@ def get_image_schema():
with open(schema_path, "r") as f:
schema_raw = f.read()
IMAGE_SCHEMA = json.loads(schema_raw)
+ else:
+ return image_schema._BASE_SCHEMA
return IMAGE_SCHEMA