[PATCH 0/3] Fix issue #301

From: Aline Manera <alinefm@br.ibm.com> Aline Manera (3): issue #301: Only list remote ISOs with valid URL issue #301: Add a loading message while listing default remote ISOs Update distros JSON files to always point to a valid URL po/en_US.po | 8 +++++++- po/kimchi.pot | 8 +++++++- po/pt_BR.po | 8 +++++++- po/zh_CN.po | 8 +++++++- src/distros.d/debian.json | 4 ++-- src/distros.d/gentoo.json | 6 +++--- src/kimchi/model/config.py | 10 ++++++++-- ui/js/src/kimchi.template_add_main.js | 4 ++++ ui/pages/template-add.html.tmpl | 12 +++++++++++- 9 files changed, 56 insertions(+), 12 deletions(-) -- 1.7.10.4

From: Aline Manera <alinefm@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@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

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

From: Aline Manera <alinefm@br.ibm.com> The remote ISO path may become invalid and we check it on backend to only return valid data to UI. But checking the remote ISO path for each distro can take some time so UI needs to properly display it to user. Do that by adding a loading message until get the backend response. Also update the .po files as new messages were added. Signed-off-by: Aline Manera <alinefm@br.ibm.com> --- po/en_US.po | 8 +++++++- po/kimchi.pot | 8 +++++++- po/pt_BR.po | 8 +++++++- po/zh_CN.po | 8 +++++++- ui/js/src/kimchi.template_add_main.js | 4 ++++ ui/pages/template-add.html.tmpl | 12 +++++++++++- 6 files changed, 43 insertions(+), 5 deletions(-) diff --git a/po/en_US.po b/po/en_US.po index 23881da..23926d6 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: kimchi 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-05 17:45-0300\n" +"POT-Creation-Date: 2014-03-07 00:54-0300\n" "PO-Revision-Date: 2013-07-11 17:32-0400\n" "Last-Translator: Crístian Viana <vianac@linux.vnet.ibm.com>\n" "Language-Team: English\n" @@ -565,6 +565,12 @@ msgstr "Create Templates from Selected ISO" msgid "I want to use a specific ISO file" msgstr "I want to use a specific ISO file" +msgid "Loading default remote ISOs ..." +msgstr "" + +msgid "Arch: " +msgstr "" + msgid "I want to use a custom URL" msgstr "I want to use a custom URL" diff --git a/po/kimchi.pot b/po/kimchi.pot index 06236d2..a8b3ecb 100755 --- a/po/kimchi.pot +++ b/po/kimchi.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-05 17:45-0300\n" +"POT-Creation-Date: 2014-03-07 00:54-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -552,6 +552,12 @@ msgstr "" msgid "I want to use a specific ISO file" msgstr "" +msgid "Loading default remote ISOs ..." +msgstr "" + +msgid "Arch: " +msgstr "" + msgid "I want to use a custom URL" msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 06db056..bca6335 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: kimchi 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-05 17:45-0300\n" +"POT-Creation-Date: 2014-03-07 00:54-0300\n" "PO-Revision-Date: 2013-06-27 10:48+0000\n" "Last-Translator: Crístian Viana <vianac@linux.vnet.ibm.com>\n" "Language-Team: Aline Manera <alinefm@br.ibm.com>\n" @@ -580,6 +580,12 @@ msgstr "Criar Modelos a partir das ISOs selecionadas" msgid "I want to use a specific ISO file" msgstr "Eu quero usar um arquivo ISO específico" +msgid "Loading default remote ISOs ..." +msgstr "" + +msgid "Arch: " +msgstr "" + msgid "I want to use a custom URL" msgstr "Eu quero usar uma URL personalizada" diff --git a/po/zh_CN.po b/po/zh_CN.po index 38a3c6c..6e0d538 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: kimchi 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-03-05 17:45-0300\n" +"POT-Creation-Date: 2014-03-07 00:54-0300\n" "PO-Revision-Date: 2013-06-27 10:48+0000\n" "Last-Translator: ShaoHe Feng <shaohef@linux.vnet.ibm.com>\n" "Language-Team: ShaoHe Feng <shaohef@linux.vnet.ibm.com>\n" @@ -569,6 +569,12 @@ msgstr "从选中的ISO中创建模板" msgid "I want to use a specific ISO file" msgstr "指定一个ISO文件" +msgid "Loading default remote ISOs ..." +msgstr "" + +msgid "Arch: " +msgstr "" + msgid "I want to use a custom URL" msgstr "我想用一个自定义的URL" diff --git a/ui/js/src/kimchi.template_add_main.js b/ui/js/src/kimchi.template_add_main.js index 098a706..d1ba527 100644 --- a/ui/js/src/kimchi.template_add_main.js +++ b/ui/js/src/kimchi.template_add_main.js @@ -249,7 +249,9 @@ kimchi.template_add_main = function() { //1-2-1 remote iso list var initRemoteIsoField = function() { + $('#load-remote-iso').show(); $('#remote-iso-field').hide(); + $('#iso-url-field').hide(); $('#select-all-remote-iso').prop('checked', false); $('#btn-template-remote-iso-create').attr('disabled', 'disabled'); }; @@ -268,7 +270,9 @@ kimchi.template_add_main = function() { } }); $('#list-remote-iso').html(html); + $('#load-remote-iso').hide() $('#remote-iso-field').show(); + $('#iso-url-field').show(); } else { kimchi.message.warn(i18n['KCHTMPL6001W']); } diff --git a/ui/pages/template-add.html.tmpl b/ui/pages/template-add.html.tmpl index 5c66753..afe22dd 100644 --- a/ui/pages/template-add.html.tmpl +++ b/ui/pages/template-add.html.tmpl @@ -128,6 +128,16 @@ <h2 class="step-title">$_("Remote ISO Image")</h2> </header> + <!-- 1-2-0 --> + <div id="load-remote-iso"> + <h3 class="step-subtitle"> + <label> + <img src = "../images/theme-default/loading.gif" /> + $_("Loading default remote ISOs ...") + </label> + </h3> + </div> + <!-- 1-2-1 --> <div id="remote-iso-field" class="iso-field" style="display: none;"> <h3 class="step-subtitle"> @@ -180,7 +190,7 @@ </div> <!-- 1-2-2 --> - <div id="iso-url-field"> + <div id="iso-url-field" style="display: none;"> <h3 class="step-subtitle"> <label> <input type="checkbox" id="iso-url-check"> -- 1.7.10.4

From: Aline Manera <alinefm@br.ibm.com> Although we only list the distros with a valid URL we need to make sure to always package distros JSON files with a valid values. So fix the URL's for Debian Wheezy and Gentoo Signed-off-by: Aline Manera <alinefm@br.ibm.com> --- src/distros.d/debian.json | 4 ++-- src/distros.d/gentoo.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/distros.d/debian.json b/src/distros.d/debian.json index 0754cf3..17111c0 100644 --- a/src/distros.d/debian.json +++ b/src/distros.d/debian.json @@ -3,7 +3,7 @@ "name": "debian-Wheezy", "os_distro": "debian", "os_arch": "x86_64", - "os_version": "7.2.0", - "path": "http://cdimage.debian.org/debian-cd/7.2.0-live/amd64/iso-hybrid/debian-live-..." + "os_version": "7.4.0", + "path": "http://ftp.acc.umu.se/debian-cd/7.4.0-live/amd64/iso-hybrid/debian-live-7.4-..." } ] diff --git a/src/distros.d/gentoo.json b/src/distros.d/gentoo.json index fa5e55b..2f9a669 100644 --- a/src/distros.d/gentoo.json +++ b/src/distros.d/gentoo.json @@ -1,9 +1,9 @@ [ { - "name": "gentoo-20131010", + "name": "gentoo-20140227", "os_distro": "gentoo", "os_arch": "x86_64", - "os_version": "20131010", - "path": "http://distfiles.gentoo.org/releases/amd64/autobuilds/current-iso/install-am..." + "os_version": "20140227", + "path": "http://distfiles.gentoo.org/releases/amd64/autobuilds/current-iso/install-am..." } ] -- 1.7.10.4

On 2014年03月07日 12:11, Aline Manera wrote:
From: Aline Manera <alinefm@br.ibm.com>
Although we only list the distros with a valid URL we need to make sure to always package distros JSON files with a valid values. So fix the URL's for Debian Wheezy and Gentoo
Signed-off-by: Aline Manera <alinefm@br.ibm.com> --- src/distros.d/debian.json | 4 ++-- src/distros.d/gentoo.json | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/distros.d/debian.json b/src/distros.d/debian.json index 0754cf3..17111c0 100644 --- a/src/distros.d/debian.json +++ b/src/distros.d/debian.json @@ -3,7 +3,7 @@ "name": "debian-Wheezy", "os_distro": "debian", "os_arch": "x86_64", - "os_version": "7.2.0", - "path": "http://cdimage.debian.org/debian-cd/7.2.0-live/amd64/iso-hybrid/debian-live-..." + "os_version": "7.4.0", + "path": "http://ftp.acc.umu.se/debian-cd/7.4.0-live/amd64/iso-hybrid/debian-live-7.4-..." } ] diff --git a/src/distros.d/gentoo.json b/src/distros.d/gentoo.json index fa5e55b..2f9a669 100644 --- a/src/distros.d/gentoo.json +++ b/src/distros.d/gentoo.json @@ -1,9 +1,9 @@ [ { - "name": "gentoo-20131010", + "name": "gentoo-20140227", "os_distro": "gentoo", "os_arch": "x86_64", - "os_version": "20131010", - "path": "http://distfiles.gentoo.org/releases/amd64/autobuilds/current-iso/install-am..." + "os_version": "20140227", + "path": "http://distfiles.gentoo.org/releases/amd64/autobuilds/current-iso/install-am..." I would prefer to provide users with stable release rather than latest build ones. So what about http://gentoo.osuosl.org/releases/amd64/12.1/livedvd-x86-amd64-32ul-2012.1.i... ? } ]

I would prefer to provide users with stable release rather than latest build ones. So what about http://gentoo.osuosl.org/releases/amd64/12.1/livedvd-x86-amd64-32ul-2012.1.i... ? There is no such concept in Gentoo. After you install any image and run
Am 07-03-2014 06:37, schrieb Royce Lv: the equivalent of "yum update", the system behaves exactly the same regardless of which image it was installed from. From inside its own package manager, you can choose whether you want stable or unstable releases for some (or all) packages. The weekly releases are like checkpoints with updated packages so you do not need to download a lot of updates after installing them (like if you install that 2012 image and download all updated packages released in the last 15 months). That URL you provided above is marked as a special release ("End of World Edition", because they were making fun of that Mayan theory about the end of the world in December 2012...). It is not, in any way, more stable/friendlier/anything than the weekly releases. It was just a celebration/marketing thing.

Reviewed-by: Crístian Viana <vianac@linux.vnet.ibm.com> Am 07-03-2014 01:10, schrieb Aline Manera:
From: Aline Manera <alinefm@br.ibm.com>
Aline Manera (3): issue #301: Only list remote ISOs with valid URL issue #301: Add a loading message while listing default remote ISOs Update distros JSON files to always point to a valid URL
po/en_US.po | 8 +++++++- po/kimchi.pot | 8 +++++++- po/pt_BR.po | 8 +++++++- po/zh_CN.po | 8 +++++++- src/distros.d/debian.json | 4 ++-- src/distros.d/gentoo.json | 6 +++--- src/kimchi/model/config.py | 10 ++++++++-- ui/js/src/kimchi.template_add_main.js | 4 ++++ ui/pages/template-add.html.tmpl | 12 +++++++++++- 9 files changed, 56 insertions(+), 12 deletions(-)
participants (3)
-
Aline Manera
-
Crístian Viana
-
Royce Lv