summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-09-24 08:21:59 +0300
committerLars Wirzenius <liw@liw.fi>2020-09-24 08:29:02 +0300
commit06bb21ddd7c4c6d47faf2536e88e025d02272837 (patch)
tree17c7be33e290f8d17084e777abeeeb9c32d254d5
parent26e8fb1878f0327c4a07f11ea50d4a9de984748b (diff)
downloadvmdb2-06bb21ddd7c4c6d47faf2536e88e025d02272837.tar.gz
chore: convert yarns/ to use subprocess instead of cliapp
-rw-r--r--yarns/900-implements.yarn9
-rw-r--r--yarns/lib.py6
2 files changed, 10 insertions, 5 deletions
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn
index c0b7af1..4123fc6 100644
--- a/yarns/900-implements.yarn
+++ b/yarns/900-implements.yarn
@@ -11,8 +11,13 @@ This chapter contains the implementations for all scenario steps.
IMPLEMENTS WHEN user runs vmdb2 (.*)
args = get_next_match()
vmdb2 = os.path.join(srcdir, 'vmdb2')
- exit, out, err = cliapp.runcmd_unchecked([vmdb2] + args.split())
- vars['exit'] = exit
+ p = subprocess.Popen(
+ [vmdb2] + args.split(),
+ stdin=subprocess.DEVNULL,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ out, err = p.communicate()
+ vars['exit'] = p.returncode
vars['stdout'] = out.decode()
vars['stderr'] = err.decode()
diff --git a/yarns/lib.py b/yarns/lib.py
index 1171387..e9d9776 100644
--- a/yarns/lib.py
+++ b/yarns/lib.py
@@ -1,10 +1,10 @@
import os
+import subprocess
import sys
-import cliapp
from yarnutils import *
-srcdir = os.environ['SRCDIR']
-datadir = os.environ['DATADIR']
+srcdir = os.environ["SRCDIR"]
+datadir = os.environ["DATADIR"]
vars = Variables(datadir)