clustershell icon indicating copy to clipboard operation
clustershell copied to clipboard

silent messages in task.shell()

Open bgajjela opened this issue 6 years ago • 3 comments

Hello,

whenever we run commands using task.shell(command,nodes) there are some messages mostly gibberish , how can we silence those messages something like

clush -o -q -w node[1-100] 'uname -a'

-q, --quiet be quiet, print essential output only

Thanks, Bharath

bgajjela avatar Jun 15 '18 03:06 bgajjela

-q is already doing what you want. What are the messages you want to get rid of?

Also, -o is expecting an argument. In your case, I think -q is used as an argument to -o instead of one to clush. Try again without -o for now.

degremont avatar Jun 18 '18 09:06 degremont

Hello ,

Thanks for the response.I believe i didn't explain the request properly ,Sorry about that. Iam not using command line.

So Iam using python api to call task.shell () with few linux commands as parameters. When task.run() is executed it does print default messages which we see whenever we try to ssh to the node. I was trying to silence those messages just like what we do "-q" in command line.

Is there a way in python api to silence those default messages?

Thanks Bharath

bgajjela avatar Jun 18 '18 13:06 bgajjela

OK. What you are looking for is ssh_options tuning from task_self()

task_self().set_info("ssh_options", "-q") 

You can retrieve current value using:

task_self().info("ssh_options") 

degremont avatar Jun 18 '18 13:06 degremont