Hide Forgot
Description of problem: There is a check when calling 'stop' on whether the domain is running and it ends with bash error "!=: unary operator expected" Version-Release number of selected component (if applicable): resource-agents-3.9.5-15.el7.x86_64 pacemaker-1.1.10-15.el7.x86_64 How reproducible: always Steps to Reproduce: 1/ export OCF_FUNCTIONS_DIR=/usr/lib/ocf/lib/heartbeat 1a/ export OCF_RESKEY_config=/var/lib/pacemaker/cts/lxc/lxc1.xml 1b/ export OCF_RESKEY_force_stop='yes' 2/ /usr/lib/ocf/resource.d/heartbeat/VirtualDomain start 3/ /usr/lib/ocf/resource.d/heartbeat/VirtualDomain stop Actual results: error in bash comparison Expected results: bash comparison done right Additional info: It probably has no effect on real function but does not look right. Full list of commandline commands and their output: # virsh -c lxc:/// list Id Name State ---------------------------------------------------- # export OCF_FUNCTIONS_DIR=/usr/lib/ocf/lib/heartbeat OCF_RESKEY_config=/var/lib/pacemaker/cts/lxc/lxc1.xml OCF_RESKEY_force_stop='yes' # /usr/lib/ocf/resource.d/heartbeat/VirtualDomain start DEBUG: Virtual domain lxc1 is currently error: failed to get domain 'lxc1' error: Domain not found: No domain with matching name 'lxc1'. Domain lxc1 created from /var/lib/pacemaker/cts/lxc/lxc1.xml DEBUG: Virtual domain lxc1 is currently running. WARNING: crm_resource failed to set utilization attribute cpu: Resource 'default' not found: No such device or address Error performing operation: No such device or address WARNING: crm_resource failed to set utilization attribute hv_memory: Resource 'default' not found: No such device or address Error performing operation: No such device or address # /usr/lib/ocf/resource.d/heartbeat/VirtualDomain status DEBUG: Virtual domain lxc1 is currently running. # virsh -c lxc:/// list Id Name State ---------------------------------------------------- 30858 lxc1 running # /usr/lib/ocf/resource.d/heartbeat/VirtualDomain stop DEBUG: Virtual domain lxc1 is currently running. INFO: Issuing forced shutdown (destroy) request for domain lxc1. Domain lxc1 destroyed /usr/lib/ocf/resource.d/heartbeat/VirtualDomain: line 310: [: !=: unary operator expected
Created attachment 806530 [details] Fixes force stop error
The bash comparison is fine. The status local variable was not initialized. I've uploaded a patch to fix this. -- Vossel
I have verified that the problem no longer exists in resource-agents-3.9.5-26.el7.x86_64 export OCF_RESKEY^Config=/var/lib/libvirt/lxc/duck-03-node01.xml OCF_RESKEY_hypervisor=lxc:/// [root@duck-03 ~]# vl Id Name State ---------------------------------------------------- [root@duck-03 ~]# /usr/lib/ocf/resource.d/heartbeat/VirtualDomain start DEBUG: Virtual domain duck-03-node01 is not running: failed to get domain 'duck-03-node01' domain not found: no domain with matching name 'duck-03-node01' Domain duck-03-node01 created from /var/lib/libvirt/lxc/duck-03-node01.xml DEBUG: Virtual domain duck-03-node01 is currently running. WARNING: crm_resource failed to set utilization attribute cpu: Resource 'default' not found: No such device or address Error performing operation: No such device or address WARNING: crm_resource failed to set utilization attribute hv_memory: Resource 'default' not found: No such device or address Error performing operation: No such device or address [root@duck-03 ~]# /usr/lib/ocf/resource.d/heartbeat/VirtualDomain status DEBUG: Virtual domain duck-03-node01 is currently running. # /usr/lib/ocf/resource.d/heartbeat/VirtualDomain stop DEBUG: Virtual domain duck-03-node01 is currently running. INFO: Issuing graceful shutdown request for domain duck-03-node01. Domain duck-03-node01 is being shutdown DEBUG: Virtual domain duck-03-node01 is currently running. ... DEBUG: Virtual domain duck-03-node01 is currently running. INFO: Issuing forced shutdown (destroy) request for domain duck-03-node01. domain duck-03-node01 destroyed DEBUG: Virtual domain duck-03-node01 is not running: failed to get domain 'duck-03-node01' domain not found: no domain with matching name 'duck-03-node01'
This request was resolved in Red Hat Enterprise Linux 7.0. Contact your manager or support representative in case you have further questions about the request.