[PATCH 1/7] urlfetcher: return repository information for distribution trees

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

 



This adds a method to the Distro class that returns some extra data for
the distribution tree in case it is known to be a package repository (as
opposed to a directory of installed images).

Patches that determine the information for some Distro subclasses will
follow.
---
 virtinst/urlfetcher.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index 69c152a89..84555cfb6 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -580,6 +580,10 @@ class Distro(object):
     _xen_kernel_paths = []
     version_from_content = []
 
+    _repo_type = None
+    _repo_url = None
+    _repo_version = None
+
     def __init__(self, fetcher, arch, vmtype):
         self.fetcher = fetcher
         self.type = vmtype
@@ -635,6 +639,12 @@ class Distro(object):
         raise RuntimeError(_("Could not find boot.iso in %s tree." %
                            self.name))
 
+    def getRepoData(self):
+        if not self._repo_type:
+            raise RuntimeError(_("%s is not a repository." %
+                               self.fetcher.location))
+        return [self._repo_type, self._repo_url, self._repo_version]
+
     def _check_osvariant_valid(self, os_variant):
         return OSDB.lookup_os(os_variant) is not None
 
-- 
2.14.3

_______________________________________________
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