diff options
| author | jaypipes@gmail.com <> | 2011-01-18 10:24:20 -0500 |
|---|---|---|
| committer | jaypipes@gmail.com <> | 2011-01-18 10:24:20 -0500 |
| commit | 785c5df3d17bb158ef2c1a66ce59ee8e6d4236b1 (patch) | |
| tree | 7ed5648388f722004f15db67022ad0b3d017680e /bin/stack | |
| parent | c9610db6c4d573568bd4b6dc390df99349b0a4ea (diff) | |
| download | nova-785c5df3d17bb158ef2c1a66ce59ee8e6d4236b1.tar.gz nova-785c5df3d17bb158ef2c1a66ce59ee8e6d4236b1.tar.xz nova-785c5df3d17bb158ef2c1a66ce59ee8e6d4236b1.zip | |
Removes circular import issues from bin/stack and replaces utils.loads with json.loads. Fixes Bug#704424
Diffstat (limited to 'bin/stack')
| -rwxr-xr-x | bin/stack | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -22,6 +22,7 @@ import eventlet eventlet.monkey_patch() +import json import os import pprint import sys @@ -38,7 +39,6 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): sys.path.insert(0, possible_topdir) import gflags -from nova import utils FLAGS = gflags.FLAGS @@ -106,8 +106,12 @@ def do_request(controller, method, params=None): 'X-OpenStack-Project': FLAGS.project} req = urllib2.Request(url, data, headers) - resp = urllib2.urlopen(req) - return utils.loads(resp.read()) + try: + resp = urllib2.urlopen(req) + except urllib2.HTTPError, e: + print e.read() + sys.exit(1) + return json.loads(resp.read()) if __name__ == '__main__': |
