Fix the all and allc commands so they work with the new data format
This commit is contained in:
@@ -12,7 +12,7 @@ class AutoCommand:
|
||||
failure("No such network: %s" % spl[1])
|
||||
return
|
||||
if not spl[2].isdigit():
|
||||
failure("Must be integer, not %s" % spl[2])
|
||||
failure("Must be a number, not %s" % spl[2])
|
||||
return
|
||||
relayNum = int(spl[2])
|
||||
id, alias = main.network[spl[1]].add_relay(relayNum)
|
||||
@@ -21,6 +21,16 @@ class AutoCommand:
|
||||
rtrn = provision.provisionRelay(relayNum, spl[1])
|
||||
success("Started provisioning network %s on relay %s for alias %s" % (spl[1], spl[2], rtrn))
|
||||
return
|
||||
elif length == 2:
|
||||
if not spl[1] in main.network.keys():
|
||||
failure("No such network: %s" % spl[1])
|
||||
return
|
||||
num, alias = main.network[spl[1]].add_relay()
|
||||
success("Successfully created relay %s on network %s with alias %s" % (str(num), spl[1], alias))
|
||||
main.saveConf("network")
|
||||
rtrn = provision.provisionRelay(num, spl[1])
|
||||
success("Started provisioning network %s on relay %s for alias %s" % (spl[1], num, rtrn))
|
||||
return
|
||||
|
||||
else:
|
||||
incUsage("auto")
|
||||
|
||||
Reference in New Issue
Block a user