Removes circular import issues from bin/stack and replaces utils.loads with json.loads. Fixes Bug#704424
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
import eventlet
|
import eventlet
|
||||||
eventlet.monkey_patch()
|
eventlet.monkey_patch()
|
||||||
|
|
||||||
|
import json
|
||||||
import os
|
import os
|
||||||
import pprint
|
import pprint
|
||||||
import sys
|
import sys
|
||||||
@@ -38,7 +39,6 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
|
|||||||
sys.path.insert(0, possible_topdir)
|
sys.path.insert(0, possible_topdir)
|
||||||
|
|
||||||
import gflags
|
import gflags
|
||||||
from nova import utils
|
|
||||||
|
|
||||||
|
|
||||||
FLAGS = gflags.FLAGS
|
FLAGS = gflags.FLAGS
|
||||||
@@ -106,8 +106,12 @@ def do_request(controller, method, params=None):
|
|||||||
'X-OpenStack-Project': FLAGS.project}
|
'X-OpenStack-Project': FLAGS.project}
|
||||||
|
|
||||||
req = urllib2.Request(url, data, headers)
|
req = urllib2.Request(url, data, headers)
|
||||||
|
try:
|
||||||
resp = urllib2.urlopen(req)
|
resp = urllib2.urlopen(req)
|
||||||
return utils.loads(resp.read())
|
except urllib2.HTTPError, e:
|
||||||
|
print e.read()
|
||||||
|
sys.exit(1)
|
||||||
|
return json.loads(resp.read())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user