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
This commit is contained in:
Brian Waldon
2012-07-12 18:30:54 -07:00
parent 49bc6f94f2
commit 53acf1a0ca
7 changed files with 161 additions and 149 deletions
+11 -2
View File
@@ -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()