[chef-dev] Re: Re: Re: Any plan for CHEF-2627 (Knife SSH should return exit code based on whether or not ssh command is successful or not)


Chronological Thread 
  • From: Hui Hu < >
  • To: Jamie Winsor < >, , Maciej Pasternacki < >
  • Subject: [chef-dev] Re: Re: Re: Any plan for CHEF-2627 (Knife SSH should return exit code based on whether or not ssh command is successful or not)
  • Date: Sat, 5 May 2012 00:50:49 +0800

Hello Chef,

I've send out a pull request ( https://github.com/opscode/chef/pull/285 )  to fix  http://tickets.opscode.com/browse/CHEF-2627 .  Please review it and have a try on your env :)

Thanks & Best Regards,
Hui Hu



2012/5/3 Hui Hu < " target="_blank"> >
Thanks Jamie and Maciej for your further explanation on this feature request.

I've figured out a patch which works in my case. Will try to send a pull request for Chef devs to review.


Thanks & Best Regards,
Hui Hu



2012/5/3 Jamie Winsor < " target="_blank"> >
I don't see how this is a useless feature. Without writing any additional code to scrub the output of Knife SSH or reading it yourself, how do you know if 1 out of the 400 nodes you just sent a command to failed?

Command line tools should return with a status code which communicates to the user if their intentions were successful or not, and if possible, why (this is why we don't just have two exit codes - 0 or 1). As it is, Knife SSH fails silently when commanding multiple nodes.

A non zero exit code with an output of nodes that did not execute their commands successfully sounds like a very fair request and how I would expect Knife SSH to behave.

Hui Hu - it shouldn't be a terribly difficult task to get this done. You should sign the CLA and do the work if you want this ticket expedited. 

-- 
Jamie Winsor
@resetexistence

On Wednesday, May 2, 2012 at 2:51 AM, AJ Christensen wrote:

The feature sounds so incredibly useless you may have to contribute it
yourself. Even then I'd be dubious about it being accepted apart from
solely as a bug fix.

You do not need an SSH-as-a-framework system.


--AJ

BIG +1 on this.

I'm using knife ssh to execute maintenance commands in parallel. Diagnostic output is hard to miss when there are many machines. Knife should at the very least exit a non-zero status, and optimally print at the end of the session list of machines with non-zero exit status (and the respective statuses).

-- M

On May 2, 2012, at 7:53 , Hui Hu wrote:

Hello,

I've been using Chef for several months.

Are Chef developers going to fix this ticket http://tickets.opscode.com/browse/CHEF-2627 (Knife SSH should return exit code based on whether or not ssh command is successful or not) ?  I really want to know whether the command Chef::Knife::Bootstrap.run (which calls Chef::Knife::Ssh.run) is successful or not, so I can perform next step based on the result.

Thanks & Best Regards,
Hui Hu






Archive powered by MHonArc 2.6.16.

§