summaryrefslogtreecommitdiff
path: root/glanceclient/__init__.py
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-07-12 18:30:54 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-07-13 18:38:15 -0700
commit53acf1a0ca70c900267286a249e476fffe078a9f (patch)
treefe9d1c8db6b2767e2a0479abc154e42003ca326d /glanceclient/__init__.py
parent49bc6f94f29ee7286601be0451ab3dafc82a0750 (diff)
downloadpython-glanceclient-53acf1a0ca70c900267286a249e476fffe078a9f.tar.gz
Establish the supported importable interface
* Consumers of this client should not depend on being able to import any module other than glanceclient and glanceclient * The only attributs of the glanceclient module are Client and __version__ * The attributes of the glanceclient.exc modules have yet to be locked down * glanceclient.common.exceptions was replaced with a placeholder module until consumers of it are updated Change-Id: Iea9648cd06906d65764987c1f2ee5a88ebeee748
Diffstat (limited to 'glanceclient/__init__.py')
-rw-r--r--glanceclient/__init__.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/glanceclient/__init__.py b/glanceclient/__init__.py
index 33f8427..d71b8a7 100644
--- a/glanceclient/__init__.py
+++ b/glanceclient/__init__.py
@@ -14,6 +14,15 @@
# License for the specific language governing permissions and limitations
# under the License.
-from glanceclient import version
+#NOTE(bcwaldon): this try/except block is needed to run setup.py due to
+# its need to import local code before installing required dependencies
+try:
+ import glanceclient.client
+ Client = glanceclient.client.Client
+except ImportError:
+ import warnings
+ warnings.warn("Could not import glanceclient.client", ImportWarning)
-__version__ = version.version_info.deferred_version_string()
+import glanceclient.version
+
+__version__ = glanceclient.version.version_info.deferred_version_string()