spaces in comma-sep. opts

This commit is contained in:
ed 2025-08-26 23:12:10 +00:00
parent 599e82f24d
commit d30240b431
5 changed files with 6 additions and 3 deletions

View file

@ -1974,7 +1974,7 @@ def main(argv: Optional[list[str]] = None) -> None:
if not HAVE_IPV6 and al.i == "::":
al.i = "0.0.0.0"
al.i = al.i.split(",")
al.i = [x.strip() for x in al.i.split(",")]
try:
if "-" in al.p:
lo, hi = [int(x) for x in al.p.split("-")]

View file

@ -1659,6 +1659,7 @@ class AuthSrv(object):
# accept both , and : as separators between usernames
zs1, zs2 = x.replace("=", ":").split(":", 1)
grps[zs1] = zs2.replace(":", ",").split(",")
grps[zs1] = [x.strip() for x in grps[zs1]]
except:
t = '\n invalid value "{}" for argument --grp, must be groupname:username1,username2,...'
raise Exception(t.format(x))

View file

@ -130,6 +130,7 @@ def _gen_srv(log: "RootLogger", args, netdevs: dict[str, Netdev]):
nlog: "NamedLogger" = lambda msg, c=0: log("cert-gen-srv", msg, c)
names = args.crt_ns.split(",") if args.crt_ns else []
names = [x.strip() for x in names]
if not args.crt_exact:
for n in names[:]:
names.append("*.{}".format(n))

View file

@ -25,6 +25,7 @@ class PWHash(object):
self.args = args
zsl = args.ah_alg.split(",")
zsl = [x.strip() for x in zsl]
alg = zsl[0]
if alg == "none":
alg = ""

View file

@ -325,7 +325,7 @@ class SvcHub(object):
self._feature_test()
decs = {k: 1 for k in self.args.th_dec.split(",")}
decs = {k.strip(): 1 for k in self.args.th_dec.split(",")}
if not HAVE_VIPS:
decs.pop("vips", None)
if not HAVE_PIL:
@ -1095,7 +1095,7 @@ class SvcHub(object):
al.tcolor = "".join([x * 2 for x in al.tcolor])
zs = al.u2sz
zsl = zs.split(",")
zsl = [x.strip() for x in zs.split(",")]
if len(zsl) not in (1, 3):
t = "invalid --u2sz; must be either one number, or a comma-separated list of three numbers (min,default,max)"
raise Exception(t)