Если я запускаю (используя миньон без хозяина):
Код: Выделить всё
salt-call cmd.run "cat hey.txt | grep 'hey there'"
Код: Выделить всё
[INFO ] Executing command 'cat hey.txt | grep 'hey there'' in directory '/root'
local:
hey there
Код: Выделить всё
def foo():
return __salt__['cmd.run']("cat hey.txt | grep 'hey there'")
Код: Выделить всё
salt-call example.foo
Код: Выделить всё
[INFO ] Executing command 'cat hey.txt | grep 'hey there'' in directory '/root'
[ERROR ] Command 'cat hey.txt | grep 'hey there'' failed with return code: 1
[ERROR ] output: hey there
stranger
I like your
boots
cat: '|': No such file or directory
cat: grep: No such file or directory
cat: 'hey there': No such file or directory
local:
hey there
stranger
I like your
boots
cat: '|': No such file or directory
cat: grep: No such file or directory
cat: 'hey there': No such file or directory
Подробнее здесь: https://stackoverflow.com/questions/381 ... -correctly