Adding external json mean cope with type conversion...

parent 36705048
...@@ -121,9 +121,9 @@ class NexDPI(): ...@@ -121,9 +121,9 @@ class NexDPI():
ipset_list = Cats[cname]['ipset']+"6" ipset_list = Cats[cname]['ipset']+"6"
else: else:
ipset_list = Cats[cname]['ipset'] ipset_list = Cats[cname]['ipset']
if not aname.startswith(Cats[cname]['nostart']) and not sername in Cats[cname]['noapps']: if not aname.startswith(tuple(Cats[cname]['nostart'])) and not sername in list(Cats[cname]['noapps']):
sh("ipset test "+ipset_list+" "+triplet+" >/dev/null 2>&1 || ipset add "+ipset_list+" "+triplet+" timeout "+Cats[cname]['timeout']+" > /dev/null 2>&1") sh("ipset test "+ipset_list+" "+triplet+" >/dev/null 2>&1 || ipset add "+ipset_list+" "+triplet+" timeout "+Cats[cname]['timeout']+" > /dev/null 2>&1")
if sername in Cats[cname]['knownapps']: if sername in list(Cats[cname]['knownapps']):
self.isknown = True self.isknown = True
continue continue
...@@ -133,9 +133,9 @@ class NexDPI(): ...@@ -133,9 +133,9 @@ class NexDPI():
ipset_list = appd['ipset']+"6" ipset_list = appd['ipset']+"6"
else: else:
ipset_list = appd['ipset'] ipset_list = appd['ipset']
if not aname.startswith(appd['nostart']): if not aname.startswith(tuple(appd['nostart'])):
sh("ipset test "+ipset_list+" "+triplet+" >/dev/null 2>&1 || ipset add "+ipset_list+" "+triplet+" timeout "+appd['timeout']+" > /dev/null 2>&1") sh("ipset test "+ipset_list+" "+triplet+" >/dev/null 2>&1 || ipset add "+ipset_list+" "+triplet+" timeout "+appd['timeout']+" > /dev/null 2>&1")
if aname.startswith(appd['knowstarts']): if aname.startswith(tuple(appd['knowstarts'])):
self.isknown = True self.isknown = True
continue continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment