From 4c33d7b726bea55a4cfbd4e5034041a8ed8416f1 Mon Sep 17 00:00:00 2001 From: John Eckersberg Date: Sun, 20 Jan 2008 10:21:30 -0500 Subject: common module used by all netapp modules (just ssh currently) --- func/minion/modules/netapp/common.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 func/minion/modules/netapp/common.py (limited to 'func/minion') diff --git a/func/minion/modules/netapp/common.py b/func/minion/modules/netapp/common.py new file mode 100644 index 0000000..53d46d6 --- /dev/null +++ b/func/minion/modules/netapp/common.py @@ -0,0 +1,14 @@ +import subprocess + +SSH = '/usr/bin/ssh' + +def ssh(user, host, command): + cmd = subprocess.Popen([SSH, "%s@%s" % (user, host), command], + executable=SSH, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=False) + + (out, err) = cmd.communicate() + return out -- cgit