Linting
This commit is contained in:
parent
5422d12ed1
commit
f85b52524a
|
@ -687,7 +687,7 @@ class Squirrel(Hazelnut):
|
||||||
self.clean_inundation()
|
self.clean_inundation()
|
||||||
|
|
||||||
# Broadcast a GoAway
|
# Broadcast a GoAway
|
||||||
gatlv = GoAwayTLV().construct(GoAwayType.EXIT, f"I am leaving! Good bye!")
|
gatlv = GoAwayTLV().construct(GoAwayType.EXIT, "I am leaving! Good bye!")
|
||||||
pkt = Packet.construct(gatlv)
|
pkt = Packet.construct(gatlv)
|
||||||
for hazelnut in self.activehazelnuts.values():
|
for hazelnut in self.activehazelnuts.values():
|
||||||
self.send_packet(hazelnut[0], pkt)
|
self.send_packet(hazelnut[0], pkt)
|
||||||
|
|
|
@ -219,8 +219,9 @@ class NeighbourTLV(TLV):
|
||||||
self.port.to_bytes(2, sys.byteorder)
|
self.port.to_bytes(2, sys.byteorder)
|
||||||
|
|
||||||
def handle(self, squirrel: Any, sender: Any) -> None:
|
def handle(self, squirrel: Any, sender: Any) -> None:
|
||||||
if squirrel.address == str(self.ip_address) and squirrel.port == self.port :
|
if squirrel.address == str(self.ip_address) and squirrel.port == self.port:
|
||||||
#This case should never happen (and in our protocol it is not possible), but we include this test as a security measure.
|
# This case should never happen (and in our protocol it is not possible),
|
||||||
|
# but we include this test as a security measure.
|
||||||
return
|
return
|
||||||
if not (str(self.ip_address), self.port) in squirrel.activehazelnuts \
|
if not (str(self.ip_address), self.port) in squirrel.activehazelnuts \
|
||||||
and not (str(self.ip_address), self.port) in squirrel.potentialhazelnuts:
|
and not (str(self.ip_address), self.port) in squirrel.potentialhazelnuts:
|
||||||
|
|
|
@ -5,7 +5,7 @@ import curses
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from .hazel import Hazelnut, Squirrel, Worm, HazelManager, Inondator
|
from .hazel import Hazelnut, Squirrel
|
||||||
from .messages import Packet, HelloTLV
|
from .messages import Packet, HelloTLV
|
||||||
from .term_manager import TermManager
|
from .term_manager import TermManager
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue