Clean up exception caught in _validate_and_build_base_options

As mentioned in the TODO info, patch
https://review.openstack.org/#/c/418066/
has been released in oslo.serialization
2.18.0, so it's time to clean this up.

Change-Id: Iaff716feb5f65740b3bd8aeaa899665cb599e878
This commit is contained in:
Kevin_Zheng 2017-05-08 14:26:42 +08:00 committed by Zhenyu Zheng
parent 57bf7f49cf
commit 8964a5e13b

View File

@ -19,7 +19,6 @@
"""Handles all requests relating to compute resources (e.g. guest VMs,
networking and storage of VMs, and compute hosts on which they run)."""
import base64
import collections
import copy
import functools
@ -772,14 +771,7 @@ class API(base.Base):
if user_data:
try:
base64utils.decode_as_bytes(user_data)
except (base64.binascii.Error, TypeError):
# TODO(harlowja): reduce the above exceptions caught to
# only type error once we get a new oslo.serialization
# release that captures and makes only one be output.
#
# We can eliminate the capture of `binascii.Error` when:
#
# https://review.openstack.org/#/c/418066/ is released.
except TypeError:
raise exception.InstanceUserDataMalformed()
# When using Neutron, _check_requested_secgroups will translate and