bugcrmsh - Bugs: bug #40821, crm configure commands exit with...

 
 

bug #40821: crm configure commands exit with status 0 on error

Submitted by:  Patrick Hemmer <phemmer>
Submitted on:  Thu 05 Dec 2013 11:28:15 PM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  Kristoffer Grönlund <krig>
Open/Closed:  Open

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 31 Jan 2014 03:25:13 PM UTC, comment #4: 

Here's an update on the status of this issue:

I've confirmed that validation errors like this are incorrectly treated as errors when not on a TTY. Unfortunately it's a bit of hairy code that needs cleaning up and I haven't had time to do it.

Hopefully I will have a fix for this soon.

Kristoffer Grönlund <krig>
Project AdministratorIn charge of this item.
Wed 08 Jan 2014 01:23:47 PM UTC, comment #3: 

Oh, maybe I didn't understand what was going on: Is the operation failing after the warning? I thought it still succeeded (as you would expect). That does sound like a bug, then. I will look into it.

Kristoffer Grönlund <krig>
Project AdministratorIn charge of this item.
Fri 03 Jan 2014 09:22:29 PM UTC, comment #2: 

Perhaps a "--batch" option should be added then.
In my opinion, when a warning is printed, the operation should ultimately succeed. Anything that causes the operation to fail is an error, not a warning.

There are other cases where I want warnings ignored, such as when my timeout thresholds are below the recommended values.

Patrick Hemmer <phemmer>
Fri 03 Jan 2014 09:32:39 AM UTC, comment #1: 

Hi,

This will be fixed in the next version of crmsh (that is, the version released after 1.2.6) -- At least the issue of crm commands not returning a useful return code on errors.

However, the second case is more difficult to solve in such a way, since the problem you are seeing is classified as a warning and not an error. Maybe something I could add is an extra strict mode which treats warnings as errors, and returns an error code for warnings as well.

Kristoffer Grönlund <krig>
Project AdministratorIn charge of this item.
Thu 05 Dec 2013 11:28:15 PM UTC, original submission:  

When attempting to perform a change on the command line, the `crm configure` commands don't return a useful status code to indicate failure. This makes it impossible to use in an automated fashion.

In the past I've been using `crm configure ... | grep ERROR:`, but I just ran across a situation where that doesn't even work:

# CIB_shadow=puppet crm configure primitive hapi-dns-internal ocf:cloud:Route53Addr params name=rsc.mydomain.com. zone=mydomain.com. ttl=30 source=eth0 meta failure-timeout=120 op stop timeout=120 op monitor interval=30 timeout=60 op start timeout=60 on-fail=ignore </dev/null; echo $?
WARNING: Resources hapi-dns-external,hapi-dns-internal violate uniqueness for parameter "zone": "mydomain.com."
0

When run from a terminal, the command prompts because of the uniqueness violation. But when run from something like puppet, STDIN is /dev/null and so it fails.

Version: crmsh 1.2.5 (Build d258d9bea1062c58da880896865868b48b7fd911)

Patrick Hemmer <phemmer>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by krig (Posted a comment)
  • -email is unavailable- added by phemmer (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-01-31 krig StatusFixed => Confirmed
    2014-01-03 krig StatusNone => Fixed
        Assigned toNone => krig

    Back to the top


    Powered by Savane 3.5