SSH port to str and vlan bad slice

This commit is contained in:
Ethanell 2020-03-01 15:01:13 +01:00
parent 112223314d
commit 648a3fcc07
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,7 @@ def insert_router_ipv4(insert: [(IPv4Address, str, IPv4Address, int)], interface
for i in insert:
if ((i[0] not in ipl) or not (ipl[ipl.find(i[0]):5].replace(" ", ""))) and (i[1] not in ipl):
cmd = ["ssh", "-i", key, "-o", "StrictHostKeyChecking no", f"{user}@{host}", "-p", port, f"/ip arp add address={i[0]} mac-address={i[1]} interface={interface}".replace("'", "")]
cmd = ["ssh", "-i", key, "-o", "StrictHostKeyChecking no", f"{user}@{host}", "-p", str(port), f"/ip arp add address={i[0]} mac-address={i[1]} interface={interface}".replace("'", "")]
if not debug:
run(cmd)
else:

View file

@ -21,7 +21,7 @@ def insert_whmcs_ipv4(insert: [(IPv4Address, str, IPv4Address, int)], interface:
gateway = insert[0][0]
del insert[0]
# Get vlan if given
if interface[:5] == "vlan":
if interface[:4] == "vlan":
try:
vlan = int(interface[4:])
except ValueError: