except (LookupError, ImportError) as e:
raise RuntimeError("Unable to load %(app_name)s from "
"configuration file %(conf_file)s."
- "\nGot: %(e)r" % locals())
+ "\nGot: %(e)r" % {'app_name': app_name,
+ 'conf_file': conf_file,
+ 'e': e})
@webob.dec.wsgify
def __call__(self, req):
- print ("*" * 40) + " REQUEST ENVIRON"
+ print(("*" * 40) + " REQUEST ENVIRON")
for key, value in req.environ.items():
print(key, "=", value)
print
resp = req.get_response(self.application)
- print ("*" * 40) + " RESPONSE HEADERS"
+ print(("*" * 40) + " RESPONSE HEADERS")
for (key, value) in resp.headers.iteritems():
print(key, "=", value)
print
Iterator that prints the contents of a wrapper string iterator
when iterated.
"""
- print ("*" * 40) + " BODY"
+ print(("*" * 40) + " BODY")
for part in app_iter:
sys.stdout.write(part)
sys.stdout.flush()
def test_lookup_nonexistant(self):
stack_name = 'wibble'
- req = self._get('/stacks/%(stack_name)s' % locals())
+ req = self._get('/stacks/%(stack_name)s' % {
+ 'stack_name': stack_name})
error = heat_exc.StackNotFound(stack_name='a')
self.m.StubOutWithMock(rpc, 'call')
def test_lookup_resource_nonexistant(self):
stack_name = 'wibble'
- req = self._get('/stacks/%(stack_name)s/resources' % locals())
+ req = self._get('/stacks/%(stack_name)s/resources' % {
+ 'stack_name': stack_name})
error = heat_exc.StackNotFound(stack_name='a')
self.m.StubOutWithMock(rpc, 'call')