Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #206 from davidvossel/master

Medium: VirtualDomain: Properly detect defined lxc domains
  • Loading branch information...
commit 0c39611443898db95244ffd451a34e8314b52b53 2 parents 34730f4 + 63bcc71
@dmuhamedagic dmuhamedagic authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 heartbeat/VirtualDomain
View
8 heartbeat/VirtualDomain
@@ -205,8 +205,12 @@ VirtualDomain_Define() {
if [ -z "$DOMAIN_NAME" ]; then
# Spin until we have a domain name
while true; do
- virsh_output=`virsh ${VIRSH_OPTIONS} define ${OCF_RESKEY_config}`
- domain_name=`echo "$virsh_output" | sed -e 's/Domain \(.*\) defined from .*$/\1/'`
+ virsh_output=$((virsh ${VIRSH_OPTIONS} define ${OCF_RESKEY_config}) 2>&1)
+ domain_name=`echo "$virsh_output" | sed -n -e 's/Domain \(.*\) defined from .*$/\1/p'`
+ if [ -n "$domain_name" ]; then
+ break;
+ fi
+ domain_name=`echo $virsh_output | sed -n -e "s/.* '\(.*\)' already exists .*/\1/p"`
if [ -n "$domain_name" ]; then
break;
fi
Please sign in to comment.
Something went wrong with that request. Please try again.