Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 789140

Summary: RFE: Implement batch processing that stops on first error
Product: Red Hat Enterprise Linux 7 Reporter: Jaroslav Kortus <jkortus>
Component: pcsAssignee: Chris Feist <cfeist>
Status: CLOSED NOTABUG QA Contact: cluster-qe <cluster-qe>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: abeekhof, cluster-maint, tojeline
Target Milestone: rcKeywords: FutureFeature
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-13 05:25:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1205796    

Description Jaroslav Kortus 2012-02-09 22:22:52 UTC
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:

Comment 2 Andrew Beekhof 2012-02-10 13:18:01 UTC
Chris, something to keep in mind when you're implementing pcs.

Comment 3 Andrew Beekhof 2012-08-16 03:51:23 UTC
Moving to the pcs component

Comment 7 Tomas Jelinek 2015-03-12 14:23:22 UTC
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.

Comment 8 Chris Feist 2015-04-13 05:25:15 UTC
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.