[root@ ~]# salt-master --version
salt-master 2014.7.0 (Helium)
[root@ ~]# salt-minion --version
salt-minion 2014.7.0 (Helium)
[root@ ~]# cat test.py
def test():
import salt.client
local = salt.client.LocalClient()
print local.cmd('*','cmd.run',['df -h'])
test()
[root@ ~]# /usr/local/saltstack/bin/python test.py
{'172.16.50.137': 'Filesystem Size Used Avail Use% Mounted on\n/dev/sda2 6.0G 3.4G 2.3G 60% /\ntmpfs 495M 0 495M 0% /dev/shm\n/dev/sda1 124M 28M 91M 24% /boot\n/dev/sda5 13G 1.3G 11G 11% /data'}
Exception TypeError: 'an integer is required' in <bound method MasterEvent.__del__ of <salt.utils.event.MasterEvent object at 0x2a5ced0>> ignored
[root@ ~]# cat test1.py
import salt.client
def test():
local = salt.client.LocalClient()
print local.cmd('*','cmd.run',['df -h'])
test()
[root@ ~]# /usr/local/saltstack/bin/python test1.py
{'172.16.50.137': 'Filesystem Size Used Avail Use% Mounted on\n/dev/sda2 6.0G 3.4G 2.3G 60% /\ntmpfs 495M 0 495M 0% /dev/shm\n/dev/sda1 124M 28M 91M 24% /boot\n/dev/sda5 13G 1.3G 11G 11% /data'}
this script run no error,why?