Simplify several functions
This commit is contained in:
@@ -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"""
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user