[mod] pep8

This commit is contained in:
Laurent Peuch 2016-12-02 23:23:06 +01:00 committed by Alexandre Aubin
parent 9c798e5d62
commit c468a69754
2 changed files with 3 additions and 3 deletions

View file

@ -160,7 +160,7 @@ def domain_remove(auth, domain, force=False):
raise MoulinetteError(errno.EINVAL, m18n.n('domain_unknown'))
# Check domain is not the main domain
if (domain == _get_maindomain()) :
if domain == _get_maindomain():
raise MoulinetteError(errno.EINVAL, m18n.n('domain_cannot_remove_main'))
# Check if apps are installed on the domain
@ -290,6 +290,7 @@ def get_public_ip(protocol=4):
raise MoulinetteError(errno.ENETUNREACH,
m18n.n('no_internet_connection'))
def _get_maindomain():
with open('/etc/yunohost/current_host', 'r') as f:
maindomain = f.readline().rstrip()

View file

@ -149,7 +149,6 @@ def tools_maindomain(auth, new_domain=None):
new_ssl_crt = "/etc/yunohost/certs/%s/crt.pem" % new_domain
try:
if os.path.exists(ssl_key) or os.path.lexists(ssl_key) :
os.remove(ssl_key)
if os.path.exists(ssl_crt) or os.path.lexists(ssl_crt) :