[PATCH] Deep scan: listing 'unknown' bootable isos after deep scan

From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> When the iso distro and version can't be recognized, but the iso is bootable, we shoud add it to the iso list after the deep scan. Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- src/kimchi/isoinfo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kimchi/isoinfo.py b/src/kimchi/isoinfo.py index 7e6d733..64c1bb2 100644 --- a/src/kimchi/isoinfo.py +++ b/src/kimchi/isoinfo.py @@ -285,9 +285,11 @@ def probe_iso(status_helper, params): ignore_list = params.get('ignore_list', []) def update_result(iso, ret): + path = os.path.abspath(iso) if os.path.isfile(iso) else iso if ret != ('unknown', 'unknown'): - path = os.path.abspath(iso) if os.path.isfile(iso) else iso updater({'path': path, 'distro': ret[0], 'version': ret[1]}) + else: + updater({'path': path, 'distro': 'unknown', 'version': 'unknown'}) if os.path.isdir(loc): for root, dirs, files in os.walk(loc): -- 1.8.3.1

-- Reviewed-by: Paulo Vital <pvital@linux.vnet.ibm.com> On Mon, 2014-01-13 at 13:43 -0200, Daniel Barboza wrote:
From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
When the iso distro and version can't be recognized, but the iso is bootable, we shoud add it to the iso list after the deep scan.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- src/kimchi/isoinfo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/isoinfo.py b/src/kimchi/isoinfo.py index 7e6d733..64c1bb2 100644 --- a/src/kimchi/isoinfo.py +++ b/src/kimchi/isoinfo.py @@ -285,9 +285,11 @@ def probe_iso(status_helper, params): ignore_list = params.get('ignore_list', [])
def update_result(iso, ret): + path = os.path.abspath(iso) if os.path.isfile(iso) else iso if ret != ('unknown', 'unknown'): - path = os.path.abspath(iso) if os.path.isfile(iso) else iso updater({'path': path, 'distro': ret[0], 'version': ret[1]}) + else: + updater({'path': path, 'distro': 'unknown', 'version': 'unknown'})
if os.path.isdir(loc): for root, dirs, files in os.walk(loc):

Reviewed-by: Rodrigo Trujillo <rodrigo.trujillo@linux.vnet.ibm.com> On 01/13/2014 01:43 PM, Daniel Barboza wrote:
From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
When the iso distro and version can't be recognized, but the iso is bootable, we shoud add it to the iso list after the deep scan.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- src/kimchi/isoinfo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/isoinfo.py b/src/kimchi/isoinfo.py index 7e6d733..64c1bb2 100644 --- a/src/kimchi/isoinfo.py +++ b/src/kimchi/isoinfo.py @@ -285,9 +285,11 @@ def probe_iso(status_helper, params): ignore_list = params.get('ignore_list', [])
def update_result(iso, ret): + path = os.path.abspath(iso) if os.path.isfile(iso) else iso if ret != ('unknown', 'unknown'): - path = os.path.abspath(iso) if os.path.isfile(iso) else iso updater({'path': path, 'distro': ret[0], 'version': ret[1]}) + else: + updater({'path': path, 'distro': 'unknown', 'version': 'unknown'})
if os.path.isdir(loc): for root, dirs, files in os.walk(loc):

Reviewed-by: Royce Lv<lvroyce@linux.vnet.ibm.com> On 2014年01月13日 23:43, Daniel Barboza wrote:
From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
When the iso distro and version can't be recognized, but the iso is bootable, we shoud add it to the iso list after the deep scan.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- src/kimchi/isoinfo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/isoinfo.py b/src/kimchi/isoinfo.py index 7e6d733..64c1bb2 100644 --- a/src/kimchi/isoinfo.py +++ b/src/kimchi/isoinfo.py @@ -285,9 +285,11 @@ def probe_iso(status_helper, params): ignore_list = params.get('ignore_list', [])
def update_result(iso, ret): + path = os.path.abspath(iso) if os.path.isfile(iso) else iso if ret != ('unknown', 'unknown'): - path = os.path.abspath(iso) if os.path.isfile(iso) else iso updater({'path': path, 'distro': ret[0], 'version': ret[1]}) + else: + updater({'path': path, 'distro': 'unknown', 'version': 'unknown'})
if os.path.isdir(loc): for root, dirs, files in os.walk(loc):

On 01/13/2014 01:43 PM, Daniel Barboza wrote:
From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
When the iso distro and version can't be recognized, but the iso is bootable, we shoud add it to the iso list after the deep scan.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- src/kimchi/isoinfo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/isoinfo.py b/src/kimchi/isoinfo.py index 7e6d733..64c1bb2 100644 --- a/src/kimchi/isoinfo.py +++ b/src/kimchi/isoinfo.py @@ -285,9 +285,11 @@ def probe_iso(status_helper, params): ignore_list = params.get('ignore_list', [])
def update_result(iso, ret): + path = os.path.abspath(iso) if os.path.isfile(iso) else iso if ret != ('unknown', 'unknown'): - path = os.path.abspath(iso) if os.path.isfile(iso) else iso updater({'path': path, 'distro': ret[0], 'version': ret[1]})
+ else: + updater({'path': path, 'distro': 'unknown', 'version': 'unknown'})
When the iso can't be recognized ret = ('unknown', 'unknown') So we just need to remove the 'if' statement def update_result(iso, ret): path = os.path.abspath(iso) if os.path.isfile(iso) else iso updater({'path': path, 'distro': ret[0], 'version': ret[1]})
if os.path.isdir(loc): for root, dirs, files in os.walk(loc):

On 01/14/2014 09:54 PM, Aline Manera wrote:
On 01/13/2014 01:43 PM, Daniel Barboza wrote:
From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
When the iso distro and version can't be recognized, but the iso is bootable, we shoud add it to the iso list after the deep scan.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- src/kimchi/isoinfo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/isoinfo.py b/src/kimchi/isoinfo.py index 7e6d733..64c1bb2 100644 --- a/src/kimchi/isoinfo.py +++ b/src/kimchi/isoinfo.py @@ -285,9 +285,11 @@ def probe_iso(status_helper, params): ignore_list = params.get('ignore_list', [])
def update_result(iso, ret): + path = os.path.abspath(iso) if os.path.isfile(iso) else iso if ret != ('unknown', 'unknown'): - path = os.path.abspath(iso) if os.path.isfile(iso) else iso updater({'path': path, 'distro': ret[0], 'version': ret[1]})
+ else: + updater({'path': path, 'distro': 'unknown', 'version': 'unknown'})
When the iso can't be recognized ret = ('unknown', 'unknown') So we just need to remove the 'if' statement
def update_result(iso, ret): path = os.path.abspath(iso) if os.path.isfile(iso) else iso updater({'path': path, 'distro': ret[0], 'version': ret[1]})
Good catch. I'll send a v2 with this change
if os.path.isdir(loc): for root, dirs, files in os.walk(loc):
participants (6)
-
Aline Manera
-
Daniel Barboza
-
Daniel H Barboza
-
Paulo Ricardo Paz Vital
-
Rodrigo Trujillo
-
Royce Lv