fix minor errors

This commit is contained in:
xenia 2021-06-14 05:38:18 -04:00
parent 06ce98d358
commit 3a75ad640d
3 changed files with 5 additions and 5 deletions

2
leylines/.flake8 Normal file
View File

@ -0,0 +1,2 @@
[flake8]
max-line-length = 100

View File

@ -1,5 +1,5 @@
import binascii import binascii
from typing import TypeVar, List, Tuple, Optional from typing import Optional
from pyroute2 import IPRoute, WireGuard from pyroute2 import IPRoute, WireGuard

View File

@ -1,6 +1,5 @@
import binascii import binascii
import ipaddress import ipaddress
import secrets
import sqlite3 import sqlite3
from typing import Iterable, List, NamedTuple, Optional, Set from typing import Iterable, List, NamedTuple, Optional, Set
@ -130,10 +129,9 @@ class Database:
def add_node_resource(self, id: int, resource: str) -> None: def add_node_resource(self, id: int, resource: str) -> None:
self.conn.execute("INSERT OR IGNORE INTO node_resources (node, resource) VALUES (?, ?)", self.conn.execute("INSERT OR IGNORE INTO node_resources (node, resource) VALUES (?, ?)",
(id, resource)) (id, resource))
self.conn.commit() self.conn.commit()
def remove_node_resource(self, id: int, resource: str) -> None: def remove_node_resource(self, id: int, resource: str) -> None:
self.conn.execute("DELETE FROM node_resources WHERE node=? and resource=?", self.conn.execute("DELETE FROM node_resources WHERE node=? and resource=?", (id, resource))
(id, resource))
self.conn.commit() self.conn.commit()