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>
import functools
import os
import socket
-import sys
import tempfile
import time
import traceback
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),
import eventlet
import json
import logging
-import sys
from heat.common import exception
from heat.engine import checkeddict
from heat.engine import cloud_watch
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),