summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-03-31 19:37:27 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2014-04-01 17:29:16 +0900
commit40da85eca24aba205a6804ae2a7151a91ecaed0c (patch)
tree11c0f3556f1a517ff0dceb0b8daafcb299740a4c
parent7c67afd263e0d3f7ed5fc506076a55c59a995bcd (diff)
bgp: fix pep8
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--ryu/services/protocols/bgp/api/core.py2
-rw-r--r--ryu/services/protocols/bgp/api/rtconf.py3
-rw-r--r--ryu/services/protocols/bgp/core_managers/table_manager.py2
-rw-r--r--ryu/services/protocols/bgp/info_base/ipv4.py2
-rw-r--r--ryu/services/protocols/bgp/peer.py20
-rw-r--r--ryu/services/protocols/bgp/protocols/bgp/messages.py1
-rw-r--r--ryu/services/protocols/bgp/rtconf/base.py1
-rw-r--r--ryu/services/protocols/bgp/rtconf/neighbors.py5
8 files changed, 18 insertions, 18 deletions
diff --git a/ryu/services/protocols/bgp/api/core.py b/ryu/services/protocols/bgp/api/core.py
index 284f9f93..b90ff897 100644
--- a/ryu/services/protocols/bgp/api/core.py
+++ b/ryu/services/protocols/bgp/api/core.py
@@ -40,7 +40,7 @@ def start(**kwargs):
waiter = kwargs.pop('waiter')
common_config = CommonConf(**kwargs)
eventlet.spawn(CORE_MANAGER.start, *[], **{'common_conf': common_config,
- 'waiter' : waiter})
+ 'waiter': waiter})
return True
diff --git a/ryu/services/protocols/bgp/api/rtconf.py b/ryu/services/protocols/bgp/api/rtconf.py
index 49e80229..98f51d9d 100644
--- a/ryu/services/protocols/bgp/api/rtconf.py
+++ b/ryu/services/protocols/bgp/api/rtconf.py
@@ -172,10 +172,9 @@ def get_vrfs_conf():
# network configuration related APIs
#==============================================================================
+
@register(name='network.add')
def add_network(prefix):
tm = CORE_MANAGER.get_core_service().table_manager
tm.add_to_ipv4_global_table(prefix)
return True
-
-
diff --git a/ryu/services/protocols/bgp/core_managers/table_manager.py b/ryu/services/protocols/bgp/core_managers/table_manager.py
index 60a624fa..640b6108 100644
--- a/ryu/services/protocols/bgp/core_managers/table_manager.py
+++ b/ryu/services/protocols/bgp/core_managers/table_manager.py
@@ -193,8 +193,6 @@ class TableCoreManager(object):
return vpn_table
-
-
def get_vpn6_table(self):
"""Returns global VPNv6 table.
diff --git a/ryu/services/protocols/bgp/info_base/ipv4.py b/ryu/services/protocols/bgp/info_base/ipv4.py
index 0d8a68dc..e7bdd8ff 100644
--- a/ryu/services/protocols/bgp/info_base/ipv4.py
+++ b/ryu/services/protocols/bgp/info_base/ipv4.py
@@ -31,6 +31,7 @@ class IPv4Dest(Destination, NonVrfPathProcessingMixin):
def _new_best_path(self, best_path):
NonVrfPathProcessingMixin._new_best_path(self, best_path)
+
class Ipv4Table(Table):
"""Global table to store IPv4 routing information.
@@ -58,7 +59,6 @@ class Ipv4Table(Table):
)
-
class Ipv4Path(Path):
"""Represents a way of reaching an VPNv4 destination."""
ROUTE_FAMILY = RF_IPv4_UC
diff --git a/ryu/services/protocols/bgp/peer.py b/ryu/services/protocols/bgp/peer.py
index 5dd1c83f..f2e78a6a 100644
--- a/ryu/services/protocols/bgp/peer.py
+++ b/ryu/services/protocols/bgp/peer.py
@@ -1046,31 +1046,35 @@ class Peer(Source, Sink, NeighborConfListener, Activity):
# non-MPBGP Update msg.
if not (mp_reach_attr or mp_unreach_attr):
LOG.info('Received UPDATE msg. with no MpReachNlri or '
- 'MpUnReachNlri attribute.')
+ 'MpUnReachNlri attribute.')
if not self.is_mpbgp_cap_valid(nlri.RF_IPv4_UC):
- LOG.error('Got UPDATE message with un-available afi/safi %s' % nlri.RF_IPv4_UC)
-
+ LOG.error('Got UPDATE message with un-available'
+ ' afi/safi %s' % nlri.RF_IPv4_UC)
nlri_list = update_msg.nlri_list
if len(nlri_list) > 0:
# Check for missing well-known mandatory attributes.
aspath = update_msg.get_path_attr(pathattr.AsPath.ATTR_NAME)
if not aspath:
- raise exceptions.MissingWellKnown(pathattr.AsPath.TYPE_CODE)
+ raise exceptions.MissingWellKnown(
+ pathattr.AsPath.TYPE_CODE)
# We do not have a setting to enable/disable first-as check.
# We by default do first-as check below.
if (self.is_ebgp_peer() and
not aspath.has_matching_leftmost(self.remote_as)):
- LOG.error('First AS check fails. Raise appropriate exception.')
+ LOG.error('First AS check fails. Raise appropriate'
+ ' exception.')
raise exceptions.MalformedAsPath()
origin = update_msg.get_path_attr(pathattr.Origin.ATTR_NAME)
if not origin:
- raise exceptions.MissingWellKnown(pathattr.Origin.TYPE_CODE)
+ raise exceptions.MissingWellKnown(
+ pathattr.Origin.TYPE_CODE)
nexthop = update_msg.get_path_attr(pathattr.NextHop.ATTR_NAME)
if not nexthop:
- raise exceptions.MissingWellKnown(pathattr.NextHop.TYPE_CODE)
+ raise exceptions.MissingWellKnown(
+ pathattr.NextHop.TYPE_CODE)
return True
@@ -1262,8 +1266,6 @@ class Peer(Source, Sink, NeighborConfListener, Activity):
tm = self._core_service.table_manager
tm.learn_path(w_path)
-
-
def _extract_and_handle_mpbgp_new_paths(self, update_msg):
"""Extracts new paths advertised in the given update message's
*MpReachNlri* attribute.
diff --git a/ryu/services/protocols/bgp/protocols/bgp/messages.py b/ryu/services/protocols/bgp/protocols/bgp/messages.py
index 44690d9f..6d74b1c6 100644
--- a/ryu/services/protocols/bgp/protocols/bgp/messages.py
+++ b/ryu/services/protocols/bgp/protocols/bgp/messages.py
@@ -462,7 +462,6 @@ class Update(BgpMessage):
idx += plen
recv_len += plen
-
if d[Update.WITHDRAW_NLRI]:
withdraw_list = nlri.parse(d[Update.WITHDRAW_NLRI])
# TODO(PH): We have to test how ipv4 nlri packed after path-attr are
diff --git a/ryu/services/protocols/bgp/rtconf/base.py b/ryu/services/protocols/bgp/rtconf/base.py
index 2fe0aa85..36febbc6 100644
--- a/ryu/services/protocols/bgp/rtconf/base.py
+++ b/ryu/services/protocols/bgp/rtconf/base.py
@@ -588,6 +588,7 @@ def validate_cap_enhanced_refresh(cer):
'settings: %s boolean value expected' % cer)
return cer
+
@validate(name=CAP_MBGP_IPV4)
def validate_cap_mbgp_ipv4(cmv4):
if cmv4 not in (True, False):
diff --git a/ryu/services/protocols/bgp/rtconf/neighbors.py b/ryu/services/protocols/bgp/rtconf/neighbors.py
index e949ec9e..c65af61c 100644
--- a/ryu/services/protocols/bgp/rtconf/neighbors.py
+++ b/ryu/services/protocols/bgp/rtconf/neighbors.py
@@ -149,8 +149,9 @@ class NeighborConf(ConfWithId, ConfWithStats):
REQUIRED_SETTINGS = frozenset([REMOTE_AS, IP_ADDRESS, LOCAL_ADDRESS,
LOCAL_PORT])
OPTIONAL_SETTINGS = frozenset([CAP_REFRESH,
- CAP_ENHANCED_REFRESH, CAP_MBGP_VPNV4, CAP_MBGP_IPV4,
- CAP_MBGP_VPNV6, CAP_RTC, RTC_AS, HOLD_TIME,
+ CAP_ENHANCED_REFRESH, CAP_MBGP_VPNV4,
+ CAP_MBGP_IPV4, CAP_MBGP_VPNV6,
+ CAP_RTC, RTC_AS, HOLD_TIME,
ENABLED, MULTI_EXIT_DISC, MAX_PREFIXES,
ADVERTISE_PEER_AS, SITE_OF_ORIGINS])