Skip to content

Commit 263f145

Browse files
committed
formatting
1 parent 5618c17 commit 263f145

15 files changed

Lines changed: 22 additions & 31 deletions

File tree

conpot/core/databus.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import gevent.event
2626
from lxml import etree
2727

28-
2928
logger = logging.getLogger(__name__)
3029

3130

conpot/core/fs_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"""
1919
Utils related to ConpotVFS
2020
"""
21+
2122
import fs
2223
from typing import Optional, Union
2324
from fs.permissions import Permissions

conpot/core/loggers/sqlite_log.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ def __init__(self, db_path="logs/conpot.db"):
4444

4545
def _create_db(self):
4646
cursor = self.conn.cursor()
47-
cursor.execute(
48-
"""CREATE TABLE IF NOT EXISTS events
47+
cursor.execute("""CREATE TABLE IF NOT EXISTS events
4948
(
5049
id INTEGER PRIMARY KEY AUTOINCREMENT,
5150
session TEXT,
@@ -54,8 +53,7 @@ def _create_db(self):
5453
protocol TEXT,
5554
request TEXT,
5655
response TEXT
57-
)"""
58-
)
56+
)""")
5957

6058
def log(self, event):
6159
cursor = self.conn.cursor()

conpot/emulators/kamstrup/usage_simulator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import gevent
2121
import conpot.core as conpot_core
2222

23-
2423
logger = logging.getLogger(__name__)
2524

2625

conpot/protocols/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from .snmp.snmp_server import SNMPServer
2929
from .tftp.tftp_server import TftpServer
3030

31-
3231
# Defines protocol directory names inside template directories
3332
name_mapping = {
3433
"bacnet": BacnetServer,

conpot/protocols/http/command_responder.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
from conpot.utils.networking import str_to_bytes
3333
import gevent
3434

35-
3635
logger = logging.getLogger(__name__)
3736

3837

@@ -333,7 +332,7 @@ def load_status(
333332
if status != 503:
334333
# we're handling another error here.
335334
# generate a 503 response from configuration.
336-
(status, headers, trailers, payload, chunks) = self.load_status(
335+
status, headers, trailers, payload, chunks = self.load_status(
337336
503,
338337
requeststring,
339338
self.headers,
@@ -497,7 +496,7 @@ def load_entity(self, requeststring, headers, configuration, docpath):
497496

498497
except:
499498
status = 503
500-
(status, headers, trailers, payload, chunks) = self.load_status(
499+
status, headers, trailers, payload, chunks = self.load_status(
501500
status, requeststring, self.headers, headers, configuration, docpath
502501
)
503502

@@ -565,7 +564,7 @@ def send_error(self, code, message=None):
565564
logger.info(message)
566565

567566
# generate the appropriate status code, header and payload
568-
(status, headers, trailers, payload, chunks) = self.load_status(
567+
status, headers, trailers, payload, chunks = self.load_status(
569568
code,
570569
requeststring.partition("?")[0],
571570
self.headers,
@@ -626,7 +625,7 @@ def do_TRACE(self):
626625
if self.server.disable_method_trace is True:
627626
# Method disabled by configuration. Fall back to 501.
628627
status = 501
629-
(status, headers, _, payload, _) = self.load_status(
628+
status, headers, _, payload, _ = self.load_status(
630629
status, self.path, self.headers, headers, configuration, docpath
631630
)
632631

@@ -689,7 +688,7 @@ def do_HEAD(self):
689688
if self.server.disable_method_head is True:
690689
# Method disabled by configuration. Fall back to 501.
691690
status = 501
692-
(status, headers, _, _, _) = self.load_status(
691+
status, headers, _, _, _ = self.load_status(
693692
status, self.path, self.headers, headers, configuration, docpath
694693
)
695694

@@ -709,14 +708,14 @@ def do_HEAD(self):
709708

710709
if entity_xml:
711710
# A config item exists for this entity. Handle it..
712-
(status, headers, _, _, _) = self.load_entity(
711+
status, headers, _, _, _ = self.load_entity(
713712
self.path, headers, configuration, docpath
714713
)
715714

716715
else:
717716
# No config item could be found. Fall back to a standard 404..
718717
status = 404
719-
(status, headers, _, _, _) = self.load_status(
718+
status, headers, _, _, _ = self.load_status(
720719
status, self.path, self.headers, headers, configuration, docpath
721720
)
722721

@@ -762,7 +761,7 @@ def do_OPTIONS(self):
762761
if self.server.disable_method_options is True:
763762
# Method disabled by configuration. Fall back to 501.
764763
status = 501
765-
(status, headers, _, payload, _) = self.load_status(
764+
status, headers, _, payload, _ = self.load_status(
766765
status, self.path, self.headers, headers, configuration, docpath
767766
)
768767

@@ -846,14 +845,14 @@ def do_GET(self):
846845

847846
if entity_xml:
848847
# A config item exists for this entity. Handle it..
849-
(status, headers, trailers, payload, chunks) = self.load_entity(
848+
status, headers, trailers, payload, chunks = self.load_entity(
850849
self.path, headers, configuration, docpath
851850
)
852851

853852
else:
854853
# No config item could be found. Fall back to a standard 404..
855854
status = 404
856-
(status, headers, trailers, payload, chunks) = self.load_status(
855+
status, headers, trailers, payload, chunks = self.load_status(
857856
status, self.path, self.headers, headers, configuration, docpath, "GET"
858857
)
859858

@@ -914,14 +913,14 @@ def do_POST(self):
914913

915914
if entity_xml:
916915
# A config item exists for this entity. Handle it..
917-
(status, headers, trailers, payload, chunks) = self.load_entity(
916+
status, headers, trailers, payload, chunks = self.load_entity(
918917
self.path, headers, configuration, docpath
919918
)
920919

921920
else:
922921
# No config item could be found. Fall back to a standard 404..
923922
status = 404
924-
(status, headers, trailers, payload, chunks) = self.load_status(
923+
status, headers, trailers, payload, chunks = self.load_status(
925924
status,
926925
self.path,
927926
self.headers,

conpot/protocols/ipmi/fakebmc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
from pyghmi.ipmi.bmc import Bmc
2121

22-
2322
logger = logging.getLogger()
2423

2524

conpot/protocols/ipmi/ipmi_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def initiate_session(self, data, address, session):
162162
if channel != 0xE:
163163
self.close_server_session()
164164
return
165-
(clientaddr, clientlun) = struct.unpack("BB", data[17:19])
165+
clientaddr, clientlun = struct.unpack("BB", data[17:19])
166166
level &= 0b1111
167167
self.send_auth_cap(
168168
myaddr, mylun, clientaddr, clientlun, session.sockaddr

conpot/protocols/kamstrup_management/command_responder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
from . import commands
2121

22-
2322
logger = logging.getLogger(__name__)
2423

2524

conpot/protocols/kamstrup_meter/command_responder.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
from .register import KamstrupRegister
2424

25-
2625
logger = logging.getLogger(__name__)
2726

2827

0 commit comments

Comments
 (0)