Address lint concerns

This commit is contained in:
Hamish Coleman 2023-06-24 14:34:30 +01:00
parent e8c7457b80
commit 7b77950352
3 changed files with 21 additions and 21 deletions

View File

@ -48,7 +48,7 @@ class JsonUDP():
data = json.loads(data.decode('utf8'))
# TODO: We assume the first packet we get will be tagged for us
assert(data['_tag'] == tagstr)
assert (data['_tag'] == tagstr)
if data['_type'] == 'error':
raise ValueError('Error: {}'.format(data['error']))
@ -128,7 +128,7 @@ class JsonUDP():
data, _ = self.sock.recvfrom(1024)
data = json.loads(data.decode('utf8'))
# assert(data['_tag'] == tagstr)
assert(data['_type'] == 'event')
assert (data['_type'] == 'event')
del data['_tag']
del data['_type']

View File

@ -16,16 +16,16 @@ docmd() {
}
# start a supernode
docmd ${BINDIR}/supernode -v
docmd "${BINDIR}"/supernode -v
# Start the edge in the background
docmd sudo ${BINDIR}/edge -l localhost:7654 -c test >/dev/null
docmd sudo "${BINDIR}"/edge -l localhost:7654 -c test >/dev/null
# TODO:
# - send edge messages to stderr?
docmd ${TOPDIR}/scripts/n2n-ctl communities
docmd ${TOPDIR}/scripts/n2n-ctl packetstats
docmd ${TOPDIR}/scripts/n2n-ctl edges --raw
docmd "${TOPDIR}"/scripts/n2n-ctl communities
docmd "${TOPDIR}"/scripts/n2n-ctl packetstats
docmd "${TOPDIR}"/scripts/n2n-ctl edges --raw
# TODO:
# docmd ${TOPDIR}/scripts/n2n-ctl supernodes --raw
@ -35,15 +35,15 @@ docmd ${TOPDIR}/scripts/n2n-ctl edges --raw
# - last_seen timestamp
# - uptime
docmd ${TOPDIR}/scripts/n2n-ctl verbose
docmd ${TOPDIR}/scripts/n2n-ctl --write verbose 1 2>/dev/null
docmd "${TOPDIR}"/scripts/n2n-ctl verbose
docmd "${TOPDIR}"/scripts/n2n-ctl --write verbose 1 2>/dev/null
echo $?
docmd ${TOPDIR}/scripts/n2n-ctl -k $AUTH --write verbose 1
docmd "${TOPDIR}"/scripts/n2n-ctl -k $AUTH --write verbose 1
# looks strange, but we are querying the state of the "stop" verb
docmd ${TOPDIR}/scripts/n2n-ctl stop
docmd "${TOPDIR}"/scripts/n2n-ctl stop
# stop them both
docmd ${TOPDIR}/scripts/n2n-ctl -k $AUTH --write stop
docmd ${TOPDIR}/scripts/n2n-ctl -t 5645 -k $AUTH --write stop
docmd "${TOPDIR}"/scripts/n2n-ctl -k $AUTH --write stop
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 -k $AUTH --write stop

View File

@ -16,18 +16,18 @@ docmd() {
}
# start it running in the background
docmd ${BINDIR}/supernode -v
docmd "${BINDIR}"/supernode -v
docmd ${TOPDIR}/scripts/n2n-ctl -t 5645 communities
docmd ${TOPDIR}/scripts/n2n-ctl -t 5645 packetstats
docmd ${TOPDIR}/scripts/n2n-ctl -t 5645 edges --raw
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 communities
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 packetstats
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 edges --raw
docmd ${TOPDIR}/scripts/n2n-ctl -t 5645 verbose
docmd ${TOPDIR}/scripts/n2n-ctl -t 5645 -k $AUTH --write verbose 1
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 verbose
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 -k $AUTH --write verbose 1
# looks strange, but we are querying the state of the "stop" verb
docmd ${TOPDIR}/scripts/n2n-ctl -t 5645 stop
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 stop
# stop it
docmd ${TOPDIR}/scripts/n2n-ctl -t 5645 -k $AUTH --write stop
docmd "${TOPDIR}"/scripts/n2n-ctl -t 5645 -k $AUTH --write stop