[Kimchi-devel] [PATCH 1/3] issue #301: Only list remote ISOs with valid URL
Aline Manera
alinefm at linux.vnet.ibm.com
Fri Mar 7 04:10:58 UTC 2014
From: Aline Manera <alinefm at br.ibm.com>
The remote ISO path may become invalid after some time and it prevents
user to create a template from it.
To avoid those kind of errors, only list the distros with valid URL.
Signed-off-by: Aline Manera <alinefm at br.ibm.com>
---
src/kimchi/model/config.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/config.py b/src/kimchi/model/config.py
index 5c90f0d..d44ef90 100644
--- a/src/kimchi/model/config.py
+++ b/src/kimchi/model/config.py
@@ -27,7 +27,7 @@ from kimchi.featuretests import FeatureTests
from kimchi.model.debugreports import DebugReportsModel
from kimchi.screenshot import VMScreenshot
from kimchi.swupdate import SoftwareUpdate
-from kimchi.utils import kimchi_log
+from kimchi.utils import check_url_path, kimchi_log
class ConfigModel(object):
@@ -91,7 +91,13 @@ class DistrosModel(object):
self.distros = distroloader.get()
def get_list(self):
- return sorted(self.distros.keys())
+ res = []
+ # only return distro with valid URL
+ for distro, data in self.distros.iteritems():
+ url = data['path']
+ if check_url_path(url):
+ res.append(distro)
+ return sorted(res)
class DistroModel(object):
--
1.7.10.4
More information about the Kimchi-devel
mailing list