Reviewed-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
On 2014年03月07日 12:10, Aline Manera wrote:
From: Aline Manera <alinefm(a)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(a)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):