Skip to content

Commit

Permalink
T4930: code style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sskaje committed Nov 20, 2024
1 parent 1f639e9 commit 4af2079
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions python/vyos/ifconfig/wireguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,15 @@ def reset_peer(self, interface, peer_name=None):

if not address or not port:
if peer_name is not None:
print(f"Peer {peer_name} endpoint not set")
print(f'Peer {peer_name} endpoint not set')
continue

cmd = f"wg set {self.config['ifname']} peer {public_key} endpoint {address}:{port}"
try:
print(f"Resetting {self.config['ifname']} peer {public_key} endpoint to {address}:{port} ... ", end='')
print(
f'Resetting {self.config['ifname']} peer {public_key} endpoint to {address}:{port} ... ',
end=''
)
self._cmd(cmd, env={'WG_ENDPOINT_RESOLUTION_RETRIES': '5'})
print('done')
except:
Expand Down Expand Up @@ -272,7 +275,10 @@ def update(self, config):
else:
cmd += ' endpoint {address}:{port}'

self._cmd(cmd.format(**peer_config), env={'WG_ENDPOINT_RESOLUTION_RETRIES': '5'})
self._cmd(
cmd.format(**peer_config),
env={'WG_ENDPOINT_RESOLUTION_RETRIES': '5'},
)
except:
# todo: logging
pass
Expand Down

0 comments on commit 4af2079

Please sign in to comment.