Use specific Exception

Change generic KuryrException to the specfic one - ConflictConfigOption

Depends-On: I448cf979fb87de7fe57325cca579b47b43c37f36
Change-Id: I90a961d5b9dc825a4ea933a69ded1c8b57ade7e9
This commit is contained in:
Kien Nguyen 2017-11-14 11:51:31 +07:00
parent 66729d4195
commit 666b2fb70c
1 changed files with 2 additions and 10 deletions

View File

@ -889,11 +889,7 @@ def network_driver_create_network():
{'neutron_network_name': neutron_network_name,
'network': network})
if network_shared != shared:
# NOTE(kiennt): Use generic KuryrException to unblock
# patch 516228 for merging. Will change
# it to ConflictOption exception in the
# follow-up.
raise exceptions.KuryrException(
raise exceptions.ConflictConfigOption(
'Network %(network_id)s had option '
'shared=%(network_shared)s, conflict with the given option '
'shared=%(shared)s', {
@ -1544,11 +1540,7 @@ def ipam_request_pool():
pool_cidr = ipaddress.ip_network(six.text_type(prefixes[0]))
if pool_cidr == cidr:
if shared != existing_pools[0]['shared']:
# NOTE(kiennt): Use generic KuryrException to unblock
# patch 516228 for merging. Will change
# it to ConflictOption exception in the
# follow-up.
raise exceptions.KuryrException(
raise exceptions.ConflictConfigOption(
'There is already existing subnet pool '
'with %(cidr)s but with shared = %(shared)s',
{'cidr': cidr,