summaryrefslogtreecommitdiff
path: root/arper.py
diff options
context:
space:
mode:
authorScott <[email protected]>2022-01-26 21:35:20 -0800
committerScott <[email protected]>2022-01-26 21:35:20 -0800
commite6f32fdd9b373dfcd100c7accb41f57d83c2f0a1 (patch)
treeeea4985bc43238fbd070c783441f08988f581973 /arper.py
parent36fea7f15ed17150691b5b3ead75450e575229ef (diff)
Ahem. Still running black?
Diffstat (limited to 'arper.py')
-rw-r--r--arper.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/arper.py b/arper.py
index 39aecf9..29a8a12 100644
--- a/arper.py
+++ b/arper.py
@@ -131,10 +131,7 @@ class Arper(persistent.Persistent):
mac = mac.lower()
ip = ip.strip()
cached_state[mac] = ip
- if (
- len(cached_state)
- > config.config['arper_min_entries_to_be_valid']
- ):
+ if len(cached_state) > config.config['arper_min_entries_to_be_valid']:
return cls(cached_state)
else:
msg = f'{cache_file} is invalid: only {len(cached_state)} entries. Deleting it.'
@@ -147,12 +144,8 @@ class Arper(persistent.Persistent):
@overrides
def save(self) -> bool:
if len(self.state) > config.config['arper_min_entries_to_be_valid']:
- logger.debug(
- f'Persisting state to {config.config["arper_cache_location"]}'
- )
- with file_utils.FileWriter(
- config.config['arper_cache_location']
- ) as wf:
+ logger.debug(f'Persisting state to {config.config["arper_cache_location"]}')
+ with file_utils.FileWriter(config.config['arper_cache_location']) as wf:
for (mac, ip) in self.state.items():
mac = mac.lower()
print(f'{mac}, {ip}', file=wf)