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 os
|
||||
import socket
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import traceback
|
||||
|
@ -210,9 +209,9 @@ class EngineManager(manager.Manager):
|
|||
|
||||
try:
|
||||
s = parser.Stack(context, 'validate', template, 0, params)
|
||||
except KeyError:
|
||||
res = 'A Fn::FindInMap operation referenced'\
|
||||
'a non-existent map [%s]' % sys.exc_value
|
||||
except KeyError as ex:
|
||||
res = ('A Fn::FindInMap operation referenced '
|
||||
'a non-existent map [%s]' % str(ex))
|
||||
|
||||
response = {'ValidateTemplateResult': {
|
||||
'Description': 'Malformed Query Response [%s]' % (res),
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
import eventlet
|
||||
import json
|
||||
import logging
|
||||
import sys
|
||||
from heat.common import exception
|
||||
from heat.engine import checkeddict
|
||||
from heat.engine import cloud_watch
|
||||
|
@ -112,9 +111,9 @@ class Stack(object):
|
|||
response = None
|
||||
try:
|
||||
order = self.get_create_order()
|
||||
except KeyError:
|
||||
except KeyError as ex:
|
||||
res = 'A Ref operation referenced a non-existent key '\
|
||||
'[%s]' % sys.exc_value
|
||||
'[%s]' % str(ex)
|
||||
|
||||
response = {'ValidateTemplateResult': {
|
||||
'Description': 'Malformed Query Response [%s]' % (res),
|
||||
|
|
Loading…
Reference in New Issue