summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-07-30 20:19:10 +0200
committerChristian Poessinger <christian@poessinger.com>2021-07-30 20:19:10 +0200
commitec713e585ace09beb9942d928e0099a35dcdd0f2 (patch)
treee19dd2d90d1762a9ae8983f7aa3a00669fe0cda4 /python
parentf520182b56e34428e9d9491ba062025cc9bea971 (diff)
downloadvyos-1x-ec713e585ace09beb9942d928e0099a35dcdd0f2.tar.gz
vyos-1x-ec713e585ace09beb9942d928e0099a35dcdd0f2.zip
vyos.util: drop custom implementations in favor of is_systemd_service_running()
Commit f520182b ("vyos.util: add is_systemd_service_running() helper function") added a new helper function that can be used to check if a systemd service is running. Drop all custom implementations in favor of this library call.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/configsession.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py
index 670e6c7fc..f28ad09c5 100644
--- a/python/vyos/configsession.py
+++ b/python/vyos/configsession.py
@@ -10,14 +10,14 @@
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License along with this library;
-# if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import os
import re
import sys
import subprocess
-from vyos.util import call
+from vyos.util import is_systemd_service_running
CLI_SHELL_API = '/bin/cli-shell-api'
SET = '/opt/vyatta/sbin/my_set'
@@ -73,8 +73,7 @@ def inject_vyos_env(env):
env['vyos_validators_dir'] = '/usr/libexec/vyos/validators'
# if running the vyos-configd daemon, inject the vyshim env var
- ret = call('systemctl is-active --quiet vyos-configd.service')
- if not ret:
+ if is_systemd_service_running('vyos-configd.service'):
env['vyshim'] = '/usr/sbin/vyshim'
return env