On Tue, Jun 7, 2011 at 2:26 PM, Michael Hanselmann <[email protected]> wrote:
> Signed-off-by: Michael Hanselmann <[email protected]>
> ---
>  lib/backend.py |    1 +
>  lib/cmdlib.py  |    4 ++++
>  2 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/lib/backend.py b/lib/backend.py
> index 295cd12..d2cc885 100644
> --- a/lib/backend.py
> +++ b/lib/backend.py
> @@ -2330,6 +2330,7 @@ def FinalizeExport(instance, snap_disks):
>              instance.beparams[constants.BE_VCPUS])
>   config.set(constants.INISECT_INS, 'disk_template', instance.disk_template)
>   config.set(constants.INISECT_INS, 'hypervisor', instance.hypervisor)
> +  config.set(constants.INISECT_INS, "tags", " ".join(instance.GetTags()))
>
>   nic_total = 0
>   for nic_count, nic in enumerate(instance.nics):
> diff --git a/lib/cmdlib.py b/lib/cmdlib.py
> index 221a7a6..5216b1c 100644
> --- a/lib/cmdlib.py
> +++ b/lib/cmdlib.py
> @@ -8167,9 +8167,13 @@ class LUInstanceCreate(LogicalUnit):
>         nics.append(ndict)
>       self.op.nics = nics
>
> +    if not self.op.tags and einfo.has_option(constants.INISECT_INS, "tags"):
> +      self.op.tags = einfo.get(constants.INISECT_INS, "tags").split()
> +
>     if (self.op.hypervisor is None and
>         einfo.has_option(constants.INISECT_INS, "hypervisor")):
>       self.op.hypervisor = einfo.get(constants.INISECT_INS, "hypervisor")
> +
>     if einfo.has_section(constants.INISECT_HYP):
>       # use the export parameters but do not override the ones
>       # specified by the user
> --
> 1.7.3.5

LGTM :)

René

Reply via email to