summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Kraynev <skraynev@mirantis.com>2014-09-01 09:57:12 -0400
committerSergey Kraynev <skraynev@mirantis.com>2014-09-25 08:08:18 -0400
commit8faef30895d5b3550d50672fc454acc37992008a (patch)
tree56443707008a51f77afe0255878b6fde3c970a40
parenta7d10dc43b0d2baa48cabd97781098d14208ecec (diff)
downloadheat-8faef30895d5b3550d50672fc454acc37992008a.tar.gz
Improve error handling in api files
Change-Id: Ib9dccf5641d72aa5d16ad3179d0df030c7664fa6 Closes-Bug: #1364018
-rwxr-xr-xbin/heat-api4
-rwxr-xr-xbin/heat-api-cfn4
-rwxr-xr-xbin/heat-api-cloudwatch4
3 files changed, 9 insertions, 3 deletions
diff --git a/bin/heat-api b/bin/heat-api
index a05a64bdb..18c619156 100755
--- a/bin/heat-api
+++ b/bin/heat-api
@@ -20,6 +20,7 @@ import eventlet
eventlet.monkey_patch(os=False)
import os
+import six
import sys
# If ../heat/__init__.py exists, add ../ to Python search path, so that
@@ -61,4 +62,5 @@ if __name__ == '__main__':
systemd.notify_once()
server.wait()
except RuntimeError as e:
- sys.exit("ERROR: %s" % e)
+ msg = six.text_type(e)
+ sys.exit("ERROR: %s" % msg)
diff --git a/bin/heat-api-cfn b/bin/heat-api-cfn
index 079a8b939..fa0dd60e6 100755
--- a/bin/heat-api-cfn
+++ b/bin/heat-api-cfn
@@ -22,6 +22,7 @@ import eventlet
eventlet.monkey_patch(os=False)
import os
+import six
import sys
# If ../heat/__init__.py exists, add ../ to Python search path, so that
@@ -63,4 +64,5 @@ if __name__ == '__main__':
systemd.notify_once()
server.wait()
except RuntimeError as e:
- sys.exit("ERROR: %s" % e)
+ msg = six.text_type(e)
+ sys.exit("ERROR: %s" % msg)
diff --git a/bin/heat-api-cloudwatch b/bin/heat-api-cloudwatch
index ad966c61c..c7d933a2b 100755
--- a/bin/heat-api-cloudwatch
+++ b/bin/heat-api-cloudwatch
@@ -22,6 +22,7 @@ import eventlet
eventlet.monkey_patch(os=False)
import os
+import six
import sys
# If ../heat/__init__.py exists, add ../ to Python search path, so that
@@ -63,4 +64,5 @@ if __name__ == '__main__':
systemd.notify_once()
server.wait()
except RuntimeError as e:
- sys.exit("ERROR: %s" % e)
+ msg = six.text_type(e)
+ sys.exit("ERROR: %s" % msg)