Reduce severity of log messages in validation methods

I noticed this while reviewing Ic2c87174.  When I read through log
files, I don't want to see errors like this that come from validating
bad user input.  Info severity is more appropriate.

Change-Id: Ib8a4dd08570923c6cade6447b52bb73d20558258
Closes-Bug: #1272565
This commit is contained in:
Carl Baldwin
2014-01-24 22:35:48 +00:00
parent f0db2da946
commit c55792244f

View File

@@ -740,12 +740,12 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2,
"subnet") % "subnet") %
{'cidr': new_subnet_cidr, {'cidr': new_subnet_cidr,
'network_id': network.id}) 'network_id': network.id})
LOG.error(_("Validation for CIDR: %(new_cidr)s failed - " LOG.info(_("Validation for CIDR: %(new_cidr)s failed - "
"overlaps with subnet %(subnet_id)s " "overlaps with subnet %(subnet_id)s "
"(CIDR: %(cidr)s)"), "(CIDR: %(cidr)s)"),
{'new_cidr': new_subnet_cidr, {'new_cidr': new_subnet_cidr,
'subnet_id': subnet.id, 'subnet_id': subnet.id,
'cidr': subnet.cidr}) 'cidr': subnet.cidr})
raise q_exc.InvalidInput(error_message=err_msg) raise q_exc.InvalidInput(error_message=err_msg)
def _validate_allocation_pools(self, ip_pools, subnet_cidr): def _validate_allocation_pools(self, ip_pools, subnet_cidr):
@@ -767,26 +767,26 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2,
start_ip = netaddr.IPAddress(ip_pool['start']) start_ip = netaddr.IPAddress(ip_pool['start'])
end_ip = netaddr.IPAddress(ip_pool['end']) end_ip = netaddr.IPAddress(ip_pool['end'])
except netaddr.AddrFormatError: except netaddr.AddrFormatError:
LOG.error(_("Found invalid IP address in pool: " LOG.info(_("Found invalid IP address in pool: "
"%(start)s - %(end)s:"), "%(start)s - %(end)s:"),
{'start': ip_pool['start'], {'start': ip_pool['start'],
'end': ip_pool['end']}) 'end': ip_pool['end']})
raise q_exc.InvalidAllocationPool(pool=ip_pool) raise q_exc.InvalidAllocationPool(pool=ip_pool)
if (start_ip.version != subnet.version or if (start_ip.version != subnet.version or
end_ip.version != subnet.version): end_ip.version != subnet.version):
LOG.error(_("Specified IP addresses do not match " LOG.info(_("Specified IP addresses do not match "
"the subnet IP version")) "the subnet IP version"))
raise q_exc.InvalidAllocationPool(pool=ip_pool) raise q_exc.InvalidAllocationPool(pool=ip_pool)
if end_ip < start_ip: if end_ip < start_ip:
LOG.error(_("Start IP (%(start)s) is greater than end IP " LOG.info(_("Start IP (%(start)s) is greater than end IP "
"(%(end)s)"), "(%(end)s)"),
{'start': ip_pool['start'], 'end': ip_pool['end']}) {'start': ip_pool['start'], 'end': ip_pool['end']})
raise q_exc.InvalidAllocationPool(pool=ip_pool) raise q_exc.InvalidAllocationPool(pool=ip_pool)
if start_ip < subnet_first_ip or end_ip > subnet_last_ip: if start_ip < subnet_first_ip or end_ip > subnet_last_ip:
LOG.error(_("Found pool larger than subnet " LOG.info(_("Found pool larger than subnet "
"CIDR:%(start)s - %(end)s"), "CIDR:%(start)s - %(end)s"),
{'start': ip_pool['start'], {'start': ip_pool['start'],
'end': ip_pool['end']}) 'end': ip_pool['end']})
raise q_exc.OutOfBoundsAllocationPool( raise q_exc.OutOfBoundsAllocationPool(
pool=ip_pool, pool=ip_pool,
subnet_cidr=subnet_cidr) subnet_cidr=subnet_cidr)
@@ -807,9 +807,9 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2,
if ip_sets[l_cursor] & ip_sets[r_cursor]: if ip_sets[l_cursor] & ip_sets[r_cursor]:
l_range = ip_ranges[l_cursor] l_range = ip_ranges[l_cursor]
r_range = ip_ranges[r_cursor] r_range = ip_ranges[r_cursor]
LOG.error(_("Found overlapping ranges: %(l_range)s and " LOG.info(_("Found overlapping ranges: %(l_range)s and "
"%(r_range)s"), "%(r_range)s"),
{'l_range': l_range, 'r_range': r_range}) {'l_range': l_range, 'r_range': r_range})
raise q_exc.OverlappingAllocationPools( raise q_exc.OverlappingAllocationPools(
pool_1=l_range, pool_1=l_range,
pool_2=r_range, pool_2=r_range,