Feature #10864

Refactor vm_helper XML parsing code

Added by anonym 2016-01-06 18:04:52 . Updated 2016-10-27 14:05:52 .

Status:
Confirmed
Priority:
Normal
Assignee:
anonym
Category:
Test suite
Target version:
Start date:
2016-01-06
Due date:
% Done:

0%

Feature Branch:
wip/refactor_update_with_rexml_document
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description

There’s a lot of code duplication, and awkwardness going on there. Some helper(s) in the spirit of iptables_chains_parse() from features/step_definitions/tor.rb would be nice.


Subtasks


History

#1 Updated by anonym 2016-01-06 18:05:01

#2 Updated by anonym 2016-10-27 14:03:58

what about something like:

update_domain_xml do |doman_xml|
  domain_xml.do_something_to_it
end


and when the block finishes it tells libvirt to update the domain with the resulting XML. We could have a domain_xml method would just returns the REXML object — I don’t really see the point of a context manager with a block.

Also, in general I think we should switch to using Xpath instead of .elements[...].each-loops.

#3 Updated by anonym 2016-10-27 14:05:53

  • Feature Branch set to wip/refactor_update_with_rexml_document

Apparently there is a WIP which does just this for VMNet. Nice!