Hide Forgot
Description of problem: Currently crm supports multiple ways how to process a batch of commands. One being feeding from stdin and another one -f parameter. Unfortunately none of these stops when the batch contains invalid or unsuccessful command. It just keeps processing the batch until EOF. Sometimes this is not the desired behaviour and stopping on first error would make more sense. I'd personally prefer this to be automatic for -f. Adding another option for either stopping or not stopping is also fine. Version-Release number of selected component (if applicable): pacemaker-1.1.6-3.el6.x86_64 How reproducible: always Steps to Reproduce: $ cat commands.txt cib use nonexistent_CIB configure primitive ClusterIP ocf:heartbeat:IPaddr2 params ip=192.168.100.11 cidr_netmask=32 op monitor interval=30s nonexistent_command crm -f commands.txt Actual results: $ crm -f commands.txt ERROR: 1: nonexistent_CIB: no such shadow CIB ERROR: 3: syntax: nonexistent_command Expected results: just ERROR 1 printed, exit != 0 (that's correct already). command on 2nd line and on not executed. Additional info:
Chris, something to keep in mind when you're implementing pcs.
Moving to the pcs component
In pcs the -f flag works differently than in crm. It does not specify a file containing a batch of commands, it points to a file containing a CIB pcs should operate on. If an operation fails, pcs returns a non-zero exit status indicating a failure occurred. This can be used to detect failures in a script calling pcs. I spoke with Jaroslav and he agrees this is not an issue in pcs.
Closing due to comment #7. Users can work on an offline cib, if they run into errors than they can decide to not load back into the system.