Re: [virt-manager PATCH] cloudinit: Clean up create_metadata and create_userdata functions from unused/unwanted arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/3/19 1:37 AM, Athina Plaskasoviti wrote:
> Signed-off-by: Athina Plaskasoviti <athina.plaskasoviti@xxxxxxxxx>
> ---
>  virtinst/install/cloudinit.py | 17 ++++-------------
>  1 file changed, 4 insertions(+), 13 deletions(-)
> 
> diff --git a/virtinst/install/cloudinit.py b/virtinst/install/cloudinit.py
> index 3cb13484..8041cc86 100644
> --- a/virtinst/install/cloudinit.py
> +++ b/virtinst/install/cloudinit.py
> @@ -9,31 +9,22 @@ class CloudInitData():
>      root_password = None
>  
>  
> -def create_metadata(scratchdir, hostname=None):
> -    if hostname:
> -        instance = hostname
> -    else:
> -        hostname = instance = "localhost"
> -    content = 'instance-id: %s\n' % instance
> -    content += 'hostname: %s\n' % hostname
> -    log.debug("Generated cloud-init metadata:\n%s", content)
> +def create_metadata(scratchdir):
>  

I dropped the newline here, and pushed this to the cloudinit branch

Thanks,
Cole

>      fileobj = tempfile.NamedTemporaryFile(
>              prefix="virtinst-", suffix="-metadata",
>              dir=scratchdir, delete=False)
>      filename = fileobj.name
>  
> +    content = ""
>      with open(filename, "w") as f:
>          f.write(content)
> +    log.debug("Generated cloud-init metadata\n%s", content)
>      return filename
>  
>  
> -def create_userdata(scratchdir, cloudinit_data, username=None, password=None):
> +def create_userdata(scratchdir, cloudinit_data):
>      content = "#cloud-config\n"
> -    if username:
> -        content += "name: %s\n" % username
> -    if password:
> -        content += "password: %s\n" % password
>  
>      rootpass = cloudinit_data.root_password
>      if rootpass == "generate":
> 


- Cole

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux