This patch introduces several minor changes to _create_xml method: - Removes redundant argument "port" - Adds new argument "libvirt_domain" which will be used in virtual mode - Updates documentation for the method - Adds default values (None) to all arguments - Calls of the functions in interactive and noninteractive methods were adjusted to be up-to-date with the changes
Changes were made as preparation for implementing virtual mode, because new virtual method will use _create_xml method differently than existing ones
Signed-off-by: Jiri Prochazka jprochaz@redhat.com --- lnst/Controller/Wizard.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/lnst/Controller/Wizard.py b/lnst/Controller/Wizard.py index e91413d..1a3ecc0 100644 --- a/lnst/Controller/Wizard.py +++ b/lnst/Controller/Wizard.py @@ -53,8 +53,9 @@ class Wizard: "'%s:%s'\n" % (hostname, port)) elif machine_interfaces is not None: filename = self._query_filename(hostname) - self._create_xml(machine_interfaces, hostname, - port, pool_dir, filename, "interactive") + self._create_xml(machine_interfaces=machine_interfaces, + hostname=hostname, pool_dir=pool_dir, + filename=filename, mode="interactive") if self._query_continuation(): continue else: @@ -131,8 +132,9 @@ class Wizard: continue else: filename = hostname + ".xml" - self._create_xml(machine_interfaces, hostname, - port, pool_dir, filename, "noninteractive") + self._create_xml(machine_interfaces=machine_interfaces, + hostname=hostname, pool_dir=pool_dir, + filename=filename, mode="noninteractive")
def _check_hostname(self, hostname): """ Checks hostnames translatibility @@ -174,15 +176,16 @@ class Wizard: sys.stderr.write("Failed creating dir\n") return None
- def _create_xml(self, machine_interfaces, hostname, - port, pool_dir, filename, mode): + def _create_xml(self, machine_interfaces=None, hostname=None, + pool_dir=None, filename=None, mode=None, + libvirt_domain=None): """ Creates slave machine XML file @param machine_interfaces Dictionary with machine's interfaces @param hostname Hostname of the machine - @param port Port on which LNST listens on the machine @param pool_dir Path to directory where XML file will be created @param filename Name of the XML file @param mode Mode in which wizard was started + @param libvirt_domain Libvirt domain of virtual host """
impl = getDOMImplementation()