summaryrefslogtreecommitdiffstats
path: root/func/minion/modules/netapp/common.py
blob: 53d46d655ee35d0b7c8c3523ec6d049e5ae4d761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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