|
|
|
@ -187,6 +187,12 @@ class Helper(object):
|
|
|
|
|
incUsage("connect")
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
int(spl[3])
|
|
|
|
|
except:
|
|
|
|
|
failure("Port must be an integer, not %s" % spl[3])
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
pool[spl[1]] = { "address": spl[2],
|
|
|
|
|
"port": spl[3],
|
|
|
|
|
"protocol": protocol,
|
|
|
|
@ -252,6 +258,16 @@ class Helper(object):
|
|
|
|
|
if not spl[2] in pool[spl[1]].keys():
|
|
|
|
|
failure("No such key: %s" % spl[2])
|
|
|
|
|
return
|
|
|
|
|
if spl[2] == "port":
|
|
|
|
|
try:
|
|
|
|
|
int(spl[3])
|
|
|
|
|
except:
|
|
|
|
|
failure("Port must be an integer, not %s" % spl[3])
|
|
|
|
|
return
|
|
|
|
|
if spl[2] == "protocol":
|
|
|
|
|
if not spl[3] in ["ssl", "plain"]:
|
|
|
|
|
failure("Protocol must be ssl or plain, not %s" % spl[3])
|
|
|
|
|
return
|
|
|
|
|
if spl[3] == pool[spl[1]][spl[2]]:
|
|
|
|
|
failure("Value already exists: %s" % spl[3])
|
|
|
|
|
return
|
|
|
|
|