[Kimchi-devel] [PATCHv3 4/8] Fix: Prevent iso links filling in osinfo.py

lvroyce0210 at gmail.com lvroyce0210 at gmail.com
Sun Jul 20 15:08:01 UTC 2014


From: Royce Lv <lvroyce at linux.vnet.ibm.com>

As we already has distro json schema based template creation,
we need to stop filling iso links filling in osinfo.py.

Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
---
 src/kimchi/osinfo.py | 24 +-----------------------
 tests/test_osinfo.py |  8 --------
 2 files changed, 1 insertion(+), 31 deletions(-)

diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index 39c9163..97f1836 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -65,31 +65,10 @@ modern_version_bases = {'x86': {'debian': '6.0', 'ubuntu': '7.10',
                                   'opensuse': '13.1',
                                   'sles': '12'}}
 
+
 icon_available_distros = [icon[5:-4] for icon in glob.glob1('%s/images/'
                           % paths.ui_dir, 'icon-*.png')]
 
-isolinks = {
-    'debian': {
-        'squeeze': 'http://cdimage.debian.org/debian-cd/6.0.7-live/amd64/'
-                   'iso-hybrid/debian-live-6.0.7-amd64-gnome-desktop.iso',
-    },
-    'ubuntu': {
-        'raring': 'http://ubuntu-releases.cs.umn.edu/13.04/'
-                  'ubuntu-13.04-desktop-amd64.iso',
-    },
-    'opensuse': {
-        '12.3': 'http://suse.mirrors.tds.net/pub/opensuse/distribution/12.3/'
-                'iso/openSUSE-12.3-DVD-x86_64.iso',
-    },
-    'fedora': {
-        '16': 'http://fedora.mirrors.tds.net/pub/fedora/releases/16/Live/'
-              'x86_64/Fedora-16-x86_64-Live-Desktop.iso',
-        '17': 'http://fedora.mirrors.tds.net/pub/fedora/releases/17/Live/'
-              'x86_64/Fedora-17-x86_64-Live-Desktop.iso',
-        '18': 'http://fedora.mirrors.tds.net/pub/fedora/releases/18/Live/'
-              'x86_64/Fedora-18-x86_64-Live-Desktop.iso',
-    },
-}
 
 defaults = {'networks': ['default'],
             'storagepool': '/storagepools/default',
@@ -113,7 +92,6 @@ def lookup(distro, version):
     params = copy.deepcopy(defaults)
     params['os_distro'] = distro
     params['os_version'] = version
-    params['cdrom'] = isolinks.get(distro, {}).get(version, '')
     arch = _get_arch()
 
     if distro in modern_version_bases[arch]:
diff --git a/tests/test_osinfo.py b/tests/test_osinfo.py
index 104e7b8..816f88b 100644
--- a/tests/test_osinfo.py
+++ b/tests/test_osinfo.py
@@ -30,14 +30,6 @@ class OSInfoTests(unittest.TestCase):
         self.assertEquals('unknown', entry['os_version'])
         self.assertEquals(['default'], entry['networks'])
 
-    def test_fedora_lookup(self):
-        cd = ('http://fedora.mirrors.tds.net/pub/fedora/releases/17/Live/'
-              'x86_64/Fedora-17-x86_64-Live-Desktop.iso')
-        entry = lookup('fedora', '17')
-        self.assertEquals(10, entry['disks'][0]['size'])
-        self.assertEquals(cd, entry['cdrom'])
-        self.assertEquals('/storagepools/default', entry['storagepool'])
-
     def test_old_distros(self):
         old_versions = {'debian': '5.0', 'ubuntu': '7.04', 'opensuse': '10.1',
                         'centos': '5.1', 'rhel': '5.1', 'fedora': '15'}
-- 
1.8.3.2




More information about the Kimchi-devel mailing list