Re: [virt-install PATCH v2 3/7] osdict: Add requires_internet() to OsMedia

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

 



On Fri, Mar 22, 2019 at 4:23 PM Fabiano Fidêncio <fidencio@xxxxxxxxxx> wrote:
>
> In order to properly do a unattended installation of some medias (as net
> installers), we have to check whether the media requires or not
> internet. Doing so by checking its variant is not the most beautiful way
> (as variants do not have a set of predefined names), but that's the best
> that can be done with the current state of osinfo-db.
>
> Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
> ---
>  virtinst/osdict.py | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/virtinst/osdict.py b/virtinst/osdict.py
> index 6486643d..67e70f62 100644
> --- a/virtinst/osdict.py
> +++ b/virtinst/osdict.py
> @@ -616,3 +616,11 @@ class _OsVariant(object):
>  class OsMedia(object):
>      def __init__(self, osinfo_media):
>          self.osinfo_media = osinfo_media
> +
> +    def requires_internet(self):
> +        if self.osinfo_media:
> +            variants = list(_OsinfoIter(self.osinfo_media.get_os.variants()))

Here it should be:
variants = list(_OsinfoIter(self.osinfo_media.get_os_variants()))

> +            for variant in variants:
> +                if "netinst" in variant.get_id():
> +                    return True
> +        return False
> --
> 2.20.1
>

_______________________________________________
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