Try another way to use subprocess; previous breaks on Linux.
authorCarl Hetherington <cth@carlh.net>
Mon, 23 Nov 2020 20:36:36 +0000 (21:36 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 23 Nov 2020 20:36:36 +0000 (21:36 +0100)
cdist

diff --git a/cdist b/cdist
index 10bed90f89262b3656d0d6ca844b6516090fad45..7efa7ea0fc3a884765f8905190a9b51358ba2c8f 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -256,9 +256,8 @@ def rmtree(a):
 
 def command(c):
     log_normal(c)
-    posix = sys.platform != 'win32'
     try:
-        r = subprocess.run(shlex.split(c, posix=posix), shell=True)
+        r = subprocess.run(c, shell=True)
         if r.returncode != 0:
             raise Error(f'command {c} failed ({r.returncode})')
     except Exception as e: