On Fri, Aug 28, 2015 at 11:17:20AM +0200, Jiri Prochazka wrote:
> This patch introduces several minor changes to _create_xml method:
> - Removes redundant argument "port"
I'm guessing this was removed because it wasn't used? But then I see it
as a bug since we do have a slave machine param for the RPC port ->
"rpc_port", I see that in the wiki it's documented incorrectly as
"rpcport" so I'll fix that.
Yes, it wasn't used, but it would be handy to have it there as well, so I
> - 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(a)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()
> --
> 2.4.3
>
> _______________________________________________
> LNST-developers mailing list
> LNST-developers(a)lists.fedorahosted.org
>
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers