Merge "Replace use of eval with ast.literal_eval"

This commit is contained in:
Jenkins
2016-08-30 12:58:59 +00:00
committed by Gerrit Code Review

View File

@@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import ast
import contextlib import contextlib
try: try:
@@ -291,8 +292,7 @@ class XenAPISession(object):
exc.details[2] == 'Failure'): exc.details[2] == 'Failure'):
params = None params = None
try: try:
# FIXME(comstud): eval is evil. params = ast.literal_eval(exc.details[3])
params = eval(exc.details[3])
except Exception: except Exception:
raise exc raise exc
raise self.XenAPI.Failure(params) raise self.XenAPI.Failure(params)