Simplify several functions

This commit is contained in:
VirtuBox
2019-10-01 04:08:54 +02:00
parent 555760164b
commit 715497d3b1
6 changed files with 27 additions and 33 deletions

View File

@@ -112,6 +112,7 @@ class WOAcme:
Log.debug(self, str(e))
Log.debug(self, "Error occured while generating "
"ssl.conf")
return 0
def check_dns(self, acme_domains):
"""Check if a list of domains point to the server IP"""

View File

@@ -5,7 +5,7 @@ import os
class WODomain():
"""WordOps domain validation utilities"""
def validatedomain(self, url):
def validate(self, url):
"""
This function returns domain name removing http:// and https://
returns domain name only with or without www as user provided.
@@ -26,7 +26,7 @@ class WODomain():
return (final_domain, domain_name)
def getdomainlevel(self, domain):
def getlevel(self, domain):
"""
Returns the domain type : domain, subdomain and the root domain
"""

View File

@@ -3,15 +3,10 @@ import string
class RANDOM:
"""Random strings generator"""
def short(self):
def gen(self, length='24'):
short_random = ''.join([random.choice
(string.ascii_letters + string.digits)
for n in range(8)])
for n in range(length)])
return short_random
def long(self):
long_random = ''.join([random.choice
(string.ascii_letters + string.digits)
for n in range(24)])
return long_random