mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 21:47:15 +02:00
Merge pull request #18362 from y-bharath14/srib-tests-v4
tests: Fixed NameError at bmpserver.py
This commit is contained in:
commit
b1711c010f
|
@ -73,7 +73,7 @@ def savepid():
|
||||||
pid = open(pid_file, "r").readline().strip()
|
pid = open(pid_file, "r").readline().strip()
|
||||||
if check_pid(int(pid)):
|
if check_pid(int(pid)):
|
||||||
timestamp_print(
|
timestamp_print(
|
||||||
"PID file already exists and program still running %s\n" % pid_file
|
f"PID file already exists and program still running {pid_file}\n"
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
@ -81,8 +81,7 @@ def savepid():
|
||||||
fd = os.open(pid_file, flags ^ os.O_EXCL, mode)
|
fd = os.open(pid_file, flags ^ os.O_EXCL, mode)
|
||||||
except (OSError, IOError, ValueError):
|
except (OSError, IOError, ValueError):
|
||||||
timestamp_print(
|
timestamp_print(
|
||||||
"issue accessing PID file %s (most likely permission or ownership)\n"
|
f"issue accessing PID file {pid_file} (most likely permission or ownership)\n"
|
||||||
% pid_file
|
|
||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -93,9 +92,9 @@ def savepid():
|
||||||
f.close()
|
f.close()
|
||||||
saved_pid = True
|
saved_pid = True
|
||||||
except IOError:
|
except IOError:
|
||||||
timestamp_print("Can not create PID file %s\n" % pid_file)
|
timestamp_print(f"Can not create PID file {pid_file}\n")
|
||||||
return False
|
return False
|
||||||
timestamp_print("Created PID file %s with value %d\n" % (pid_file, ownid))
|
timestamp_print(f"Created PID file {pid_file} with value {ownid}\n")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,9 +105,9 @@ def removepid():
|
||||||
if exc.errno == errno.ENOENT:
|
if exc.errno == errno.ENOENT:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
timestamp_print("Can not remove PID file %s\n" % pid_file)
|
timestamp_print(f"Can not remove PID file {pid_file}\n")
|
||||||
return
|
return
|
||||||
timestamp_print("Removed PID file %s\n" % pid_file)
|
timestamp_print(f"Removed PID file {pid_file}\n")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -168,7 +167,7 @@ def main():
|
||||||
timestamp_print(f"TCP session closed with {client_address}")
|
timestamp_print(f"TCP session closed with {client_address}")
|
||||||
connection.close()
|
connection.close()
|
||||||
except socket.error as sock_err:
|
except socket.error as sock_err:
|
||||||
timestamp_print(f"Socket error: {e}")
|
timestamp_print(f"Socket error: {sock_err}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
timestamp_print(f"{e}")
|
timestamp_print(f"{e}")
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Reference in a new issue