summaryrefslogtreecommitdiffstats
path: root/cucumber/features/support/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'cucumber/features/support/helpers')
-rw-r--r--cucumber/features/support/helpers/vm_helper.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/cucumber/features/support/helpers/vm_helper.rb b/cucumber/features/support/helpers/vm_helper.rb
index 3f172136..dd8ce936 100644
--- a/cucumber/features/support/helpers/vm_helper.rb
+++ b/cucumber/features/support/helpers/vm_helper.rb
@@ -15,8 +15,15 @@ class VMNet
rexml = REXML::Document.new(net_xml)
rexml.elements['network'].add_element('name')
rexml.elements['network/name'].text = @net_name
- rexml.elements['network'].add_element('uuid')
- rexml.elements['network/uuid'].text = LIBVIRT_NETWORK_UUID
+ # PGH
+ begin
+ old_net = @virt.lookup_network_by_name(@net_name)
+ rexml.elements['network'].add_element('uuid')
+ rexml.elements['network/uuid'].text = old_net.uuid
+ old_net.undefine
+ rescue
+ end
+ update(rexml.to_s)
update(rexml.to_s)
rescue Exception => e
destroy_and_undefine