def __init__(self):
self.DUMMY_FILE = '{0}/dummy.hosts'.format(tempfile.gettempdir())
pass
# def generate_hostname(self, minlen=5, maxlen=20):
# """
# Generate a random hostname between minlen and maxlen, appending
# '.example.net' (eg. oskpijsrss7.example.net)
#
# :param minlen: minimum length of the hostname (default: 5)
#
# :param maxlen: maximum length of the hostname (default: 20)
# """
#
# len = random.randint(minlen, maxlen)
#
# host_str = ''.join(
# random.choice(string.ascii_lowercase) for _ in range(len -1))
#
# host_str = '{0}{1}.example.net'.format(
# host_str, random.choice(string.digits))
#
# return host_str
评论列表
文章目录