summaryrefslogtreecommitdiffstats
path: root/bin/stack
diff options
context:
space:
mode:
authorjaypipes@gmail.com <>2011-01-19 22:46:31 +0000
committerTarmac <>2011-01-19 22:46:31 +0000
commit97d9b426f80544dd6cc82f5753783d2bf8f3957f (patch)
tree20e8c2a5930106bbbda88ce02733120a54eb29e5 /bin/stack
parentc25a105ead4cd571a1089d2dabf9f338afdd4784 (diff)
parent2f4e7b732d5cafd09a5a73cbc01583503b8ba105 (diff)
downloadnova-97d9b426f80544dd6cc82f5753783d2bf8f3957f.tar.gz
nova-97d9b426f80544dd6cc82f5753783d2bf8f3957f.tar.xz
nova-97d9b426f80544dd6cc82f5753783d2bf8f3957f.zip
Fixes for bugs:
* Bug #704422: nova-direct-api: AttributeError: 'module' object has no attribute 'ComputeAPI' * Bug #704424: bin/stack: AttributeError: port * Bug #704447: bin/stack: urllib2.HTTPError when issuing reflection request
Diffstat (limited to 'bin/stack')
-rwxr-xr-xbin/stack10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/stack b/bin/stack
index 7a6ce5960..25caca06f 100755
--- a/bin/stack
+++ b/bin/stack
@@ -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__':