Don't use sys.exc_value
sys.exc_value has been deprecated since Python 1.5, and is not thread-safe. The replacement is sys.exc_info(), but in this case we don't need even that since we have the exception in question available. Change-Id: Ibb4b354fd099fbf0d6390163eb4f7cc9e97db0e9 Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
parent
cfe391073a
commit
0da631a321
|
@ -20,7 +20,6 @@ import datetime
|
||||||
import functools
|
import functools
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
import sys
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
@ -210,9 +209,9 @@ class EngineManager(manager.Manager):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
s = parser.Stack(context, 'validate', template, 0, params)
|
s = parser.Stack(context, 'validate', template, 0, params)
|
||||||
except KeyError:
|
except KeyError as ex:
|
||||||
res = 'A Fn::FindInMap operation referenced'\
|
res = ('A Fn::FindInMap operation referenced '
|
||||||
'a non-existent map [%s]' % sys.exc_value
|
'a non-existent map [%s]' % str(ex))
|
||||||
|
|
||||||
response = {'ValidateTemplateResult': {
|
response = {'ValidateTemplateResult': {
|
||||||
'Description': 'Malformed Query Response [%s]' % (res),
|
'Description': 'Malformed Query Response [%s]' % (res),
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
import eventlet
|
import eventlet
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import sys
|
|
||||||
from heat.common import exception
|
from heat.common import exception
|
||||||
from heat.engine import checkeddict
|
from heat.engine import checkeddict
|
||||||
from heat.engine import cloud_watch
|
from heat.engine import cloud_watch
|
||||||
|
@ -112,9 +111,9 @@ class Stack(object):
|
||||||
response = None
|
response = None
|
||||||
try:
|
try:
|
||||||
order = self.get_create_order()
|
order = self.get_create_order()
|
||||||
except KeyError:
|
except KeyError as ex:
|
||||||
res = 'A Ref operation referenced a non-existent key '\
|
res = 'A Ref operation referenced a non-existent key '\
|
||||||
'[%s]' % sys.exc_value
|
'[%s]' % str(ex)
|
||||||
|
|
||||||
response = {'ValidateTemplateResult': {
|
response = {'ValidateTemplateResult': {
|
||||||
'Description': 'Malformed Query Response [%s]' % (res),
|
'Description': 'Malformed Query Response [%s]' % (res),
|
||||||
|
|
Loading…
Reference in New Issue