Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Running the underlying module command with cmd.retcode:
- [root@hd-qa-apps1 salt]# salt-call cmd.retcode 'hdfs dfs -stat /tmp_salt';
- [INFO ] Executing command 'hdfs dfs -stat /tmp_salt' in directory '/root'
- [INFO ] output: 2014-06-20 01:01:05
- local:
- 0
- [root@hd-qa-apps1 salt]# salt-call cmd.retcode 'hdfs dfs -stat /non-existent-dir'
- [INFO ] Executing command 'hdfs dfs -stat /non-existent-dir' in directory '/root'
- [ERROR ] Command 'hdfs dfs -stat /non-existent-dir' failed with return code: 1
- [ERROR ] output: stat: `/non-existent-dir': No such file or directory
- local:
- 1
- Execution the hadoop module with --out json:
- [root@hd-qa-apps1 salt]# salt-call hadoop.dfs_absent /tmpasd --out json
- [INFO ] Executing command 'hdfs dfs -stat /tmpasd' in directory '/root'
- [ERROR ] Command 'hdfs dfs -stat /tmpasd' failed with return code: 1
- [ERROR ] output: stat: `/tmpasd': No such file or directory
- {
- "local": true
- }
- [root@hd-qa-apps1 salt]# salt-call hadoop.dfs_absent /tmp --out json
- [INFO ] Executing command 'hdfs dfs -stat /tmp' in directory '/root'
- [INFO ] output: 2014-06-18 19:45:28
- {
- "local": false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement