services/protocols: fix pep8
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
039f9a154c
commit
c468fdd126
@ -58,7 +58,7 @@ CONF.register_opts([
|
|||||||
cfg.StrOpt('bind-ip', default='0.0.0.0', help='rpc-bind-ip'),
|
cfg.StrOpt('bind-ip', default='0.0.0.0', help='rpc-bind-ip'),
|
||||||
cfg.StrOpt('bgp-config-file', default=DEFAULT_CONFIG_PATH,
|
cfg.StrOpt('bgp-config-file', default=DEFAULT_CONFIG_PATH,
|
||||||
help='bgp-config-file')
|
help='bgp-config-file')
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
@add_bgp_error_metadata(code=BIN_ERROR,
|
@add_bgp_error_metadata(code=BIN_ERROR,
|
||||||
|
@ -146,9 +146,9 @@ Hello, this is Ryu BGP speaker (version %s).
|
|||||||
elif c == 'B':
|
elif c == 'B':
|
||||||
self._lookup_hist_down()
|
self._lookup_hist_down()
|
||||||
elif c == 'C':
|
elif c == 'C':
|
||||||
self._movcursor(self.curpos+1)
|
self._movcursor(self.curpos + 1)
|
||||||
elif c == 'D':
|
elif c == 'D':
|
||||||
self._movcursor(self.curpos-1)
|
self._movcursor(self.curpos - 1)
|
||||||
else:
|
else:
|
||||||
LOG.error("unknown CSI sequence. do nothing: %c" % c)
|
LOG.error("unknown CSI sequence. do nothing: %c" % c)
|
||||||
|
|
||||||
@ -267,7 +267,7 @@ Hello, this is Ryu BGP speaker (version %s).
|
|||||||
ret.append(cmpled_cmd)
|
ret.append(cmpled_cmd)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if (i+1) == len(cmds):
|
if (i + 1) == len(cmds):
|
||||||
if is_spaced:
|
if is_spaced:
|
||||||
result, cmd = cmpleter('?')
|
result, cmd = cmpleter('?')
|
||||||
result = result.value.replace('\n', '\n\r').rstrip()
|
result = result.value.replace('\n', '\n\r').rstrip()
|
||||||
@ -292,7 +292,7 @@ Hello, this is Ryu BGP speaker (version %s).
|
|||||||
else:
|
else:
|
||||||
self._startnewline(buf='Error: Not implemented')
|
self._startnewline(buf='Error: Not implemented')
|
||||||
else:
|
else:
|
||||||
if (i+1) < len(cmds):
|
if (i + 1) < len(cmds):
|
||||||
self._startnewline(buf='Error: Ambiguous command')
|
self._startnewline(buf='Error: Ambiguous command')
|
||||||
else:
|
else:
|
||||||
self._startnewline(buf=', '.join(matches))
|
self._startnewline(buf=', '.join(matches))
|
||||||
@ -374,13 +374,13 @@ Hello, this is Ryu BGP speaker (version %s).
|
|||||||
self._movcursor(self.promptlen)
|
self._movcursor(self.promptlen)
|
||||||
# <C-b>
|
# <C-b>
|
||||||
elif c == chr(0x02):
|
elif c == chr(0x02):
|
||||||
self._movcursor(self.curpos-1)
|
self._movcursor(self.curpos - 1)
|
||||||
# <C-e>
|
# <C-e>
|
||||||
elif c == chr(0x05):
|
elif c == chr(0x05):
|
||||||
self._movcursor(self.promptlen+len(self.buf))
|
self._movcursor(self.promptlen + len(self.buf))
|
||||||
# <C-f>
|
# <C-f>
|
||||||
elif c == chr(0x06):
|
elif c == chr(0x06):
|
||||||
self._movcursor(self.curpos+1)
|
self._movcursor(self.curpos + 1)
|
||||||
else:
|
else:
|
||||||
LOG.error("unknown cursor move cmd.")
|
LOG.error("unknown cursor move cmd.")
|
||||||
continue
|
continue
|
||||||
|
@ -45,11 +45,12 @@ class VRRPDumper(app_manager.RyuApp):
|
|||||||
# or
|
# or
|
||||||
#
|
#
|
||||||
# RFC 5795 6.4.1
|
# RFC 5795 6.4.1
|
||||||
#(115)+ If the protected IPvX address is an IPv4 address, then:
|
# (115)+ If the protected IPvX address is an IPv4 address,
|
||||||
|
# then:
|
||||||
# (120) * Broadcast a gratuitous ARP request containing the
|
# (120) * Broadcast a gratuitous ARP request containing the
|
||||||
# virtual router MAC address for each IP address associated
|
# virtual router MAC address for each IP address associated
|
||||||
# with the virtual router.
|
# with the virtual router.
|
||||||
#(125) + else // IPv6
|
# (125) + else // IPv6
|
||||||
# (130) * For each IPv6 address associated with the virtual
|
# (130) * For each IPv6 address associated with the virtual
|
||||||
# router, send an unsolicited ND Neighbor Advertisement with
|
# router, send an unsolicited ND Neighbor Advertisement with
|
||||||
# the Router Flag (R) set, the Solicited Flag (S) unset, the
|
# the Router Flag (R) set, the Solicited Flag (S) unset, the
|
||||||
@ -67,11 +68,12 @@ class VRRPDumper(app_manager.RyuApp):
|
|||||||
# or
|
# or
|
||||||
#
|
#
|
||||||
# RFC 5795 6.4.2
|
# RFC 5795 6.4.2
|
||||||
#(375)+ If the protected IPvX address is an IPv4 address, then:
|
# (375)+ If the protected IPvX address is an IPv4 address,
|
||||||
|
# then:
|
||||||
# (380)* Broadcast a gratuitous ARP request on that interface
|
# (380)* Broadcast a gratuitous ARP request on that interface
|
||||||
# containing the virtual router MAC address for each IPv4
|
# containing the virtual router MAC address for each IPv4
|
||||||
# address associated with the virtual router.
|
# address associated with the virtual router.
|
||||||
#(385) + else // ipv6
|
# (385) + else // ipv6
|
||||||
# (390) * Compute and join the Solicited-Node multicast
|
# (390) * Compute and join the Solicited-Node multicast
|
||||||
# address [RFC4291] for the IPv6 address(es) associated with
|
# address [RFC4291] for the IPv6 address(es) associated with
|
||||||
# the virtual router.
|
# the virtual router.
|
||||||
@ -97,10 +99,10 @@ class VRRPDumper(app_manager.RyuApp):
|
|||||||
# or
|
# or
|
||||||
#
|
#
|
||||||
# RFC5798 6.4.3
|
# RFC5798 6.4.3
|
||||||
#(605) - If the protected IPvX address is an IPv4 address, then:
|
# (605) - If the protected IPvX address is an IPv4 address, then:
|
||||||
# (610) + MUST respond to ARP requests for the IPv4 address(es)
|
# (610) + MUST respond to ARP requests for the IPv4 address(es)
|
||||||
# associated with the virtual router.
|
# associated with the virtual router.
|
||||||
#(615) - else // ipv6
|
# (615) - else // ipv6
|
||||||
# (620) + MUST be a member of the Solicited-Node multicast
|
# (620) + MUST be a member of the Solicited-Node multicast
|
||||||
# address for the IPv6 address(es) associated with the virtual
|
# address for the IPv6 address(es) associated with the virtual
|
||||||
# router.
|
# router.
|
||||||
@ -110,13 +112,13 @@ class VRRPDumper(app_manager.RyuApp):
|
|||||||
# router.
|
# router.
|
||||||
# (635) ++ If Accept_Mode is False: MUST NOT drop IPv6 Neighbor
|
# (635) ++ If Accept_Mode is False: MUST NOT drop IPv6 Neighbor
|
||||||
# Solicitations and Neighbor Advertisements.
|
# Solicitations and Neighbor Advertisements.
|
||||||
#(640) +-endif // ipv4?
|
# (640) +-endif // ipv4?
|
||||||
#(645) - MUST forward packets with a destination link-layer MAC
|
# (645) - MUST forward packets with a destination link-layer MAC
|
||||||
#address equal to the virtual router MAC address.
|
# address equal to the virtual router MAC address.
|
||||||
#(650) - MUST accept packets addressed to the IPvX address(es)
|
# (650) - MUST accept packets addressed to the IPvX address(es)
|
||||||
#associated with the virtual router if it is the IPvX address owner
|
# associated with the virtual router if it is the IPvX address
|
||||||
#or if Accept_Mode is True. Otherwise, MUST NOT accept these
|
# owner or if Accept_Mode is True. Otherwise, MUST NOT accept
|
||||||
#packets.
|
# these packets.
|
||||||
|
|
||||||
elif new_state == vrrp_event.VRRP_STATE_BACKUP:
|
elif new_state == vrrp_event.VRRP_STATE_BACKUP:
|
||||||
self.logger.info('becomes backup')
|
self.logger.info('becomes backup')
|
||||||
@ -132,19 +134,19 @@ class VRRPDumper(app_manager.RyuApp):
|
|||||||
# or
|
# or
|
||||||
#
|
#
|
||||||
# RFC 5798 6.4.2 Backup
|
# RFC 5798 6.4.2 Backup
|
||||||
#(305) - If the protected IPvX address is an IPv4 address, then:
|
# (305) - If the protected IPvX address is an IPv4 address, then:
|
||||||
# (310) + MUST NOT respond to ARP requests for the IPv4
|
# (310) + MUST NOT respond to ARP requests for the IPv4
|
||||||
# address(es) associated with the virtual router.
|
# address(es) associated with the virtual router.
|
||||||
#(315) - else // protected addr is IPv6
|
# (315) - else // protected addr is IPv6
|
||||||
# (320) + MUST NOT respond to ND Neighbor Solicitation messages
|
# (320) + MUST NOT respond to ND Neighbor Solicitation messages
|
||||||
# for the IPv6 address(es) associated with the virtual router.
|
# for the IPv6 address(es) associated with the virtual router.
|
||||||
# (325) + MUST NOT send ND Router Advertisement messages for the
|
# (325) + MUST NOT send ND Router Advertisement messages for the
|
||||||
# virtual router.
|
# virtual router.
|
||||||
#(330) -endif // was protected addr IPv4?
|
# (330) -endif // was protected addr IPv4?
|
||||||
#(335) - MUST discard packets with a destination link-layer MAC
|
# (335) - MUST discard packets with a destination link-layer MAC
|
||||||
#address equal to the virtual router MAC address.
|
# address equal to the virtual router MAC address.
|
||||||
#(340) - MUST NOT accept packets addressed to the IPvX address(es)
|
# (340) - MUST NOT accept packets addressed to the IPvX address(es)
|
||||||
#associated with the virtual router.
|
# associated with the virtual router.
|
||||||
elif new_state == vrrp_event.VRRP_STATE_INITIALIZE:
|
elif new_state == vrrp_event.VRRP_STATE_INITIALIZE:
|
||||||
if old_state is None:
|
if old_state is None:
|
||||||
self.logger.info('initialized')
|
self.logger.info('initialized')
|
||||||
|
@ -100,8 +100,8 @@ class VRRPManager(app_manager.RyuApp):
|
|||||||
|
|
||||||
instance = VRRPInstance(name, monitor.name, config, interface)
|
instance = VRRPInstance(name, monitor.name, config, interface)
|
||||||
self._instances[name] = instance
|
self._instances[name] = instance
|
||||||
#self.logger.debug('report_bricks')
|
# self.logger.debug('report_bricks')
|
||||||
#app_manager.AppManager.get_instance().report_bricks() # debug
|
# app_manager.AppManager.get_instance().report_bricks() # debug
|
||||||
monitor.start()
|
monitor.start()
|
||||||
router.start()
|
router.start()
|
||||||
|
|
||||||
|
@ -579,11 +579,11 @@ class VRRPV3StateBackup(VRRPState):
|
|||||||
# EventStateChange(VRRP_SATE_BACKUP -> VRRP_STATE_MASTER)
|
# EventStateChange(VRRP_SATE_BACKUP -> VRRP_STATE_MASTER)
|
||||||
#
|
#
|
||||||
# RFC 5795 6.4.2
|
# RFC 5795 6.4.2
|
||||||
#(375) + If the protected IPvX address is an IPv4 address, then:
|
# (375) + If the protected IPvX address is an IPv4 address, then:
|
||||||
# (380) * Broadcast a gratuitous ARP request on that interface
|
# (380) * Broadcast a gratuitous ARP request on that interface
|
||||||
# containing the virtual router MAC address for each IPv4
|
# containing the virtual router MAC address for each IPv4
|
||||||
# address associated with the virtual router.
|
# address associated with the virtual router.
|
||||||
#(385) + else // ipv6
|
# (385) + else // ipv6
|
||||||
# (390) * Compute and join the Solicited-Node multicast
|
# (390) * Compute and join the Solicited-Node multicast
|
||||||
# address [RFC4291] for the IPv6 address(es) associated with
|
# address [RFC4291] for the IPv6 address(es) associated with
|
||||||
# the virtual router.
|
# the virtual router.
|
||||||
@ -684,11 +684,11 @@ class VRRPRouterV3(VRRPRouter):
|
|||||||
# EventVRRPStateChanged(None->VRRP_STATE_MASTER)
|
# EventVRRPStateChanged(None->VRRP_STATE_MASTER)
|
||||||
#
|
#
|
||||||
# RFC 5795 6.4.1
|
# RFC 5795 6.4.1
|
||||||
#(115) + If the protected IPvX address is an IPv4 address, then:
|
# (115) + If the protected IPvX address is an IPv4 address, then:
|
||||||
# (120) * Broadcast a gratuitous ARP request containing the
|
# (120) * Broadcast a gratuitous ARP request containing the
|
||||||
# virtual router MAC address for each IP address associated
|
# virtual router MAC address for each IP address associated
|
||||||
# with the virtual router.
|
# with the virtual router.
|
||||||
#(125) + else // IPv6
|
# (125) + else // IPv6
|
||||||
# (130) * For each IPv6 address associated with the virtual
|
# (130) * For each IPv6 address associated with the virtual
|
||||||
# router, send an unsolicited ND Neighbor Advertisement with
|
# router, send an unsolicited ND Neighbor Advertisement with
|
||||||
# the Router Flag (R) set, the Solicited Flag (S) unset, the
|
# the Router Flag (R) set, the Solicited Flag (S) unset, the
|
||||||
|
@ -77,11 +77,11 @@ class RouterBase(app_manager.RyuApp):
|
|||||||
# or
|
# or
|
||||||
#
|
#
|
||||||
# RFC 5795 6.4.1
|
# RFC 5795 6.4.1
|
||||||
#(115)+ If the protected IPvX address is an IPv4 address, then:
|
# (115)+ If the protected IPvX address is an IPv4 address, then:
|
||||||
# (120) * Broadcast a gratuitous ARP request containing the
|
# (120) * Broadcast a gratuitous ARP request containing the
|
||||||
# virtual router MAC address for each IP address associated
|
# virtual router MAC address for each IP address associated
|
||||||
# with the virtual router.
|
# with the virtual router.
|
||||||
#(125) + else // IPv6
|
# (125) + else // IPv6
|
||||||
# (130) * For each IPv6 address associated with the virtual
|
# (130) * For each IPv6 address associated with the virtual
|
||||||
# router, send an unsolicited ND Neighbor Advertisement with
|
# router, send an unsolicited ND Neighbor Advertisement with
|
||||||
# the Router Flag (R) set, the Solicited Flag (S) unset, the
|
# the Router Flag (R) set, the Solicited Flag (S) unset, the
|
||||||
@ -99,11 +99,11 @@ class RouterBase(app_manager.RyuApp):
|
|||||||
# or
|
# or
|
||||||
#
|
#
|
||||||
# RFC 5795 6.4.2
|
# RFC 5795 6.4.2
|
||||||
#(375)+ If the protected IPvX address is an IPv4 address, then:
|
# (375)+ If the protected IPvX address is an IPv4 address, then:
|
||||||
# (380)* Broadcast a gratuitous ARP request on that interface
|
# (380)* Broadcast a gratuitous ARP request on that interface
|
||||||
# containing the virtual router MAC address for each IPv4
|
# containing the virtual router MAC address for each IPv4
|
||||||
# address associated with the virtual router.
|
# address associated with the virtual router.
|
||||||
#(385) + else // ipv6
|
# (385) + else // ipv6
|
||||||
# (390) * Compute and join the Solicited-Node multicast
|
# (390) * Compute and join the Solicited-Node multicast
|
||||||
# address [RFC4291] for the IPv6 address(es) associated with
|
# address [RFC4291] for the IPv6 address(es) associated with
|
||||||
# the virtual router.
|
# the virtual router.
|
||||||
@ -127,19 +127,19 @@ class RouterBase(app_manager.RyuApp):
|
|||||||
# or
|
# or
|
||||||
#
|
#
|
||||||
# RFC 5798 6.4.2 Backup
|
# RFC 5798 6.4.2 Backup
|
||||||
#(305) - If the protected IPvX address is an IPv4 address, then:
|
# (305) - If the protected IPvX address is an IPv4 address, then:
|
||||||
# (310) + MUST NOT respond to ARP requests for the IPv4
|
# (310) + MUST NOT respond to ARP requests for the IPv4
|
||||||
# address(es) associated with the virtual router.
|
# address(es) associated with the virtual router.
|
||||||
#(315) - else // protected addr is IPv6
|
# (315) - else // protected addr is IPv6
|
||||||
# (320) + MUST NOT respond to ND Neighbor Solicitation messages
|
# (320) + MUST NOT respond to ND Neighbor Solicitation messages
|
||||||
# for the IPv6 address(es) associated with the virtual router.
|
# for the IPv6 address(es) associated with the virtual router.
|
||||||
# (325) + MUST NOT send ND Router Advertisement messages for the
|
# (325) + MUST NOT send ND Router Advertisement messages for the
|
||||||
# virtual router.
|
# virtual router.
|
||||||
#(330) -endif // was protected addr IPv4?
|
# (330) -endif // was protected addr IPv4?
|
||||||
#(335) - MUST discard packets with a destination link-layer MAC
|
# (335) - MUST discard packets with a destination link-layer MAC
|
||||||
#address equal to the virtual router MAC address.
|
# address equal to the virtual router MAC address.
|
||||||
#(340) - MUST NOT accept packets addressed to the IPvX address(es)
|
# (340) - MUST NOT accept packets addressed to the IPvX address(es)
|
||||||
#associated with the virtual router.
|
# associated with the virtual router.
|
||||||
|
|
||||||
def _shutdowned(self):
|
def _shutdowned(self):
|
||||||
self.logger.debug('shutdowned')
|
self.logger.debug('shutdowned')
|
||||||
@ -169,10 +169,10 @@ class RouterBase(app_manager.RyuApp):
|
|||||||
# or
|
# or
|
||||||
#
|
#
|
||||||
# RFC5798 6.4.3
|
# RFC5798 6.4.3
|
||||||
#(605) - If the protected IPvX address is an IPv4 address, then:
|
# (605) - If the protected IPvX address is an IPv4 address, then:
|
||||||
# (610) + MUST respond to ARP requests for the IPv4 address(es)
|
# (610) + MUST respond to ARP requests for the IPv4 address(es)
|
||||||
# associated with the virtual router.
|
# associated with the virtual router.
|
||||||
#(615) - else // ipv6
|
# (615) - else // ipv6
|
||||||
# (620) + MUST be a member of the Solicited-Node multicast
|
# (620) + MUST be a member of the Solicited-Node multicast
|
||||||
# address for the IPv6 address(es) associated with the virtual
|
# address for the IPv6 address(es) associated with the virtual
|
||||||
# router.
|
# router.
|
||||||
@ -182,13 +182,13 @@ class RouterBase(app_manager.RyuApp):
|
|||||||
# router.
|
# router.
|
||||||
# (635) ++ If Accept_Mode is False: MUST NOT drop IPv6 Neighbor
|
# (635) ++ If Accept_Mode is False: MUST NOT drop IPv6 Neighbor
|
||||||
# Solicitations and Neighbor Advertisements.
|
# Solicitations and Neighbor Advertisements.
|
||||||
#(640) +-endif // ipv4?
|
# (640) +-endif // ipv4?
|
||||||
#(645) - MUST forward packets with a destination link-layer MAC
|
# (645) - MUST forward packets with a destination link-layer MAC
|
||||||
#address equal to the virtual router MAC address.
|
# address equal to the virtual router MAC address.
|
||||||
#(650) - MUST accept packets addressed to the IPvX address(es)
|
# (650) - MUST accept packets addressed to the IPvX address(es)
|
||||||
#associated with the virtual router if it is the IPvX address owner
|
# associated with the virtual router if it is the IPvX address
|
||||||
#or if Accept_Mode is True. Otherwise, MUST NOT accept these
|
# owner or if Accept_Mode is True. Otherwise, MUST NOT accept
|
||||||
#packets.
|
# these packets.
|
||||||
|
|
||||||
elif new_state == vrrp_event.VRRP_STATE_BACKUP:
|
elif new_state == vrrp_event.VRRP_STATE_BACKUP:
|
||||||
self._become_backup()
|
self._become_backup()
|
||||||
|
Loading…
Reference in New Issue
Block a user