summaryrefslogtreecommitdiff
path: root/src/conf_mode/le_cert.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/le_cert.py')
-rwxr-xr-xsrc/conf_mode/le_cert.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/conf_mode/le_cert.py b/src/conf_mode/le_cert.py
index a4dbecbaa..2db31d3fc 100755
--- a/src/conf_mode/le_cert.py
+++ b/src/conf_mode/le_cert.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2019 VyOS maintainers and contributors
+# Copyright (C) 2019-2020 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -13,8 +13,6 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#
import sys
import os
@@ -22,8 +20,8 @@ import os
import vyos.defaults
from vyos.config import Config
from vyos import ConfigError
-from vyos.util import cmd, run
-
+from vyos.util import cmd
+from vyos.util import call
vyos_conf_scripts_dir = vyos.defaults.directories['conf_mode']
@@ -85,17 +83,17 @@ def generate(cert):
# certbot will attempt to reload nginx, even with 'certonly';
# start nginx if not active
- ret = run('systemctl is-active --quiet nginx.ervice')
+ ret = call('systemctl is-active --quiet nginx.service')
if ret:
- run('sudo systemctl start nginx.service')
+ call('systemctl start nginx.service')
request_certbot(cert)
def apply(cert):
if cert is not None:
- run('sudo systemctl restart certbot.timer')
+ call('systemctl restart certbot.timer')
else:
- run('sudo systemctl stop certbot.timer')
+ call('systemctl stop certbot.timer')
return None
for dep in dependencies: