Improved readibility and fixed indentation
In some places, indentation was wrong. In this patchset, they are fixed. Also, I did some readibility improvements which I've found during indentation fixing. Change-Id: I298b9b0c557c07848c69ed23b0faa3a3147d055d
This commit is contained in:
parent
fcd47cca6e
commit
1628fb72f8
|
@ -825,10 +825,10 @@ class RouterInfo(object):
|
|||
ex_gw_port)
|
||||
fip_statuses = self.configure_fip_addresses(interface_name)
|
||||
|
||||
except (n_exc.FloatingIpSetupException):
|
||||
# All floating IPs must be put in error state
|
||||
LOG.exception(_LE("Failed to process floating IPs."))
|
||||
fip_statuses = self.put_fips_in_error_state()
|
||||
except n_exc.FloatingIpSetupException:
|
||||
# All floating IPs must be put in error state
|
||||
LOG.exception(_LE("Failed to process floating IPs."))
|
||||
fip_statuses = self.put_fips_in_error_state()
|
||||
finally:
|
||||
self.update_fip_statuses(agent, fip_statuses)
|
||||
|
||||
|
|
|
@ -202,10 +202,10 @@ class PrefixDelegation(object):
|
|||
lla_with_mask)
|
||||
|
||||
def _spawn_lla_thread(self, gw_ifname, ns_name, lla_with_mask):
|
||||
eventlet.spawn_n(self._ensure_lla_task,
|
||||
gw_ifname,
|
||||
ns_name,
|
||||
lla_with_mask)
|
||||
eventlet.spawn_n(self._ensure_lla_task,
|
||||
gw_ifname,
|
||||
ns_name,
|
||||
lla_with_mask)
|
||||
|
||||
def _delete_lla(self, router, lla_with_mask):
|
||||
if lla_with_mask and router['gw_interface']:
|
||||
|
|
|
@ -474,8 +474,8 @@ class Controller(object):
|
|||
self._plugin)
|
||||
reservations.append(reservation)
|
||||
except n_exc.QuotaResourceUnknown as e:
|
||||
# We don't want to quota this resource
|
||||
LOG.debug(e)
|
||||
# We don't want to quota this resource
|
||||
LOG.debug(e)
|
||||
|
||||
def notify(create_result):
|
||||
# Ensure usage trackers for all resources affected by this API
|
||||
|
|
|
@ -488,7 +488,7 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
|
|||
"incompatible with DHCP service enabled.")
|
||||
if ((ip_ver == 4 and subnet_prefixlen > 30) or
|
||||
(ip_ver == 6 and subnet_prefixlen > 126)):
|
||||
raise exc.InvalidInput(error_message=error_message)
|
||||
raise exc.InvalidInput(error_message=error_message)
|
||||
|
||||
net = netaddr.IPNetwork(s['cidr'])
|
||||
if net.is_multicast():
|
||||
|
|
|
@ -100,27 +100,27 @@ def get_segment_by_id(session, segment_id):
|
|||
|
||||
def get_dynamic_segment(session, network_id, physical_network=None,
|
||||
segmentation_id=None):
|
||||
"""Return a dynamic segment for the filters provided if one exists."""
|
||||
with session.begin(subtransactions=True):
|
||||
query = (session.query(segments_model.NetworkSegment).
|
||||
filter_by(network_id=network_id, is_dynamic=True))
|
||||
if physical_network:
|
||||
query = query.filter_by(physical_network=physical_network)
|
||||
if segmentation_id:
|
||||
query = query.filter_by(segmentation_id=segmentation_id)
|
||||
record = query.first()
|
||||
"""Return a dynamic segment for the filters provided if one exists."""
|
||||
with session.begin(subtransactions=True):
|
||||
query = (session.query(segments_model.NetworkSegment).
|
||||
filter_by(network_id=network_id, is_dynamic=True))
|
||||
if physical_network:
|
||||
query = query.filter_by(physical_network=physical_network)
|
||||
if segmentation_id:
|
||||
query = query.filter_by(segmentation_id=segmentation_id)
|
||||
record = query.first()
|
||||
|
||||
if record:
|
||||
return _make_segment_dict(record)
|
||||
else:
|
||||
LOG.debug("No dynamic segment found for "
|
||||
"Network:%(network_id)s, "
|
||||
"Physical network:%(physnet)s, "
|
||||
"segmentation_id:%(segmentation_id)s",
|
||||
{'network_id': network_id,
|
||||
'physnet': physical_network,
|
||||
'segmentation_id': segmentation_id})
|
||||
return None
|
||||
if record:
|
||||
return _make_segment_dict(record)
|
||||
else:
|
||||
LOG.debug("No dynamic segment found for "
|
||||
"Network:%(network_id)s, "
|
||||
"Physical network:%(physnet)s, "
|
||||
"segmentation_id:%(segmentation_id)s",
|
||||
{'network_id': network_id,
|
||||
'physnet': physical_network,
|
||||
'segmentation_id': segmentation_id})
|
||||
return None
|
||||
|
||||
|
||||
def delete_network_segment(session, segment_id):
|
||||
|
|
|
@ -48,10 +48,10 @@ class NeutronModule(object):
|
|||
}
|
||||
|
||||
def _import_or_none(self):
|
||||
try:
|
||||
return importlib.import_module(self.module_name)
|
||||
except ImportError:
|
||||
return None
|
||||
try:
|
||||
return importlib.import_module(self.module_name)
|
||||
except ImportError:
|
||||
return None
|
||||
|
||||
def installed(self):
|
||||
LOG.debug("NeutronModule installed = %s", self.module_name)
|
||||
|
@ -124,7 +124,7 @@ class NeutronModule(object):
|
|||
return providers
|
||||
|
||||
|
||||
#global scope function that should be used in service APIs
|
||||
# global scope function that should be used in service APIs
|
||||
def normalize_provider_name(name):
|
||||
return name.lower()
|
||||
|
||||
|
|
Loading…
Reference in New Issue