Skip to content

Commit

Permalink
Fix linter error W503 and ignore E402, E123
Browse files Browse the repository at this point in the history
* E402 module level import not at top of file to set scapy loglevel so that the tcpdump warning is not printed
* E123 closing bracket does not match indentation of opening bracket's line for the objects in the test Please enter the commit message for your changes. Lines starting
  • Loading branch information
juga0 committed Sep 4, 2017
1 parent 58b65be commit 8ca8259
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions dhcpcanon/dhcpcaputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@

def isoffer(packet):
"""."""
if DHCP in packet and (DHCPTypes.get(packet[DHCP].options[0][1]) == 'offer'
or packet[DHCP].options[0][1] == "offer"):
if DHCP in packet and (DHCPTypes.get(packet[DHCP].options[0][1]) ==
'offer' or packet[DHCP].options[0][1] == "offer"):
logger.debug('Packet is Offer.')
return True
return False


def isnak(packet):
"""."""
if DHCP in packet and (DHCPTypes.get(packet[DHCP].options[0][1]) == 'nak'
or packet[DHCP].options[0][1] == 'nak'):
if DHCP in packet and (DHCPTypes.get(packet[DHCP].options[0][1]) ==
'nak' or packet[DHCP].options[0][1] == 'nak'):
logger.debug('Packet is NAK.')
return True
return False


def isack(packet):
"""."""
if DHCP in packet and (DHCPTypes.get(packet[DHCP].options[0][1]) == 'ack'
or packet[DHCP].options[0][1] == 'ack'):
if DHCP in packet and (DHCPTypes.get(packet[DHCP].options[0][1]) ==
'ack' or packet[DHCP].options[0][1] == 'ack'):
logger.debug('Packet is ACK.')
return True
return False
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ skip_install = True
deps =
flake8
commands =
flake8 --max-line-length 79 dhcpcanon scripts tests
flake8 --max-line-length 79 --ignore=E402,E123 dhcpcanon scripts tests

[testenv:stats]
skip_install = True
Expand Down

0 comments on commit 8ca8259

Please sign in to comment.