diff options
| author | Ed Leafe <ed@leafe.com> | 2011-01-21 16:10:26 -0500 |
|---|---|---|
| committer | Ed Leafe <ed@leafe.com> | 2011-01-21 16:10:26 -0500 |
| commit | 09188c61d5359750f9deadcf912f0fa5fbf005b7 (patch) | |
| tree | 53006dc213fc28f8c74179516f109c93603f429a /bin/stack | |
| parent | 75f93d83be59a85b63a267dc22458a133c591f8e (diff) | |
| parent | ec60562b1a6d18e6df4024870468c0501dc692f9 (diff) | |
Resolved trunk merge conflicts
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__': |
