Merge for tox_irc_sync

This commit is contained in:
emdee
2022-10-27 06:50:47 +00:00
parent 564e24fba5
commit a3ad33495a
4 changed files with 23 additions and 24 deletions

View File

@@ -121,24 +121,6 @@ if not hasattr(unittest, 'skip'):
return _wrap1
unittest.skip = unittest_skip
def iNmapInfo(sProt, sHost, sPort, key=None, environ=None, bTest=False):
sFile = os.path.join("/tmp", f"{sHost}.{os.getpid()}.nmap")
if sProt in ['socks', 'socks5', 'tcp4']:
cmd = f"nmap -Pn -n -sT -p T:{sPort} {sHost} | grep /tcp >{sFile}"
else:
cmd = f"nmap -Pn -n -sU -p U:{sPort} {sHost} | grep /tcp >{sFile}"
iRet = os.system(cmd)
LOG.debug(f"iNmapInfo cmd={cmd} {iRet}")
if iRet != 0:
return iRet
assert os.path.exists(sFile), sFile
with open(sFile, 'rt') as oFd:
l = oFd.readlines()
assert len(l)
s = '\n'.join([s.strip() for s in l])
LOG.debug(f"iNmapInfo: {s}")
return 0
class ToxOptions():
def __init__(self):
self.ipv6_enabled = True