diff --git a/zeroconf/actions.py b/zeroconf/actions.py index e11b5b1..fc96510 100644 --- a/zeroconf/actions.py +++ b/zeroconf/actions.py @@ -2,6 +2,7 @@ import socket from zeroconf import ServiceBrowser, ServiceStateChange, Zeroconf from subprocess import Popen, PIPE +import shlex import xmltodict __all__ = [ @@ -39,7 +40,7 @@ def connected_peers(): """ peers = [] - cli = Popen('gluster --xml pool list', shell=True, stdout=PIPE, stderr=PIPE) + cli = Popen(shlex.split('gluster --xml pool list', shell=False, stdout=PIPE, stderr=PIPE)) (out, err) = cli.communicate() # TODO: catch errors (not even xml format when glusterd is not running) @@ -80,7 +81,7 @@ def connected_peers(): def peer_probe(hostname): """ Run 'gluster peer probe $hostname' against the given hostname (or IP). """ - cli = Popen('gluster --xml peer probe %s' % hostname, shell=True, stdout=PIPE, stderr=PIPE) + cli = Popen(shlex.split('gluster --xml peer probe %s' % hostname, shell=False, stdout=PIPE, stderr=PIPE)) (out, err) = cli.communicate() # TODO: catch errors diff --git a/zeroconf/version.py b/zeroconf/version.py index b794fd4..8ce9b36 100644 --- a/zeroconf/version.py +++ b/zeroconf/version.py @@ -1 +1 @@ -__version__ = '0.1.0' +__version__ = '0.1.3'