After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 747892 - validate:launcher: Handle git error properly
validate:launcher: Handle git error properly
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-devtools
git master
Other Linux
: Normal minor
: 1.5.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-15 08:15 UTC by Young Han Lee
Modified: 2015-06-24 14:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Handle git error properly (941 bytes, patch)
2015-04-15 08:16 UTC, Young Han Lee
none Details | Review
Handle git error properly (978 bytes, patch)
2015-04-15 09:23 UTC, Young Han Lee
none Details | Review

Description Young Han Lee 2015-04-15 08:15:42 UTC
_get_git_first_hash doesn't work properly when git is not installed on running system. This could happen on embedded target device like TV.

subprocess.check_output() emits 'OSError' exception in that case, but not handled.
Comment 1 Young Han Lee 2015-04-15 08:16:44 UTC
Created attachment 301595 [details] [review]
Handle git error properly
Comment 2 Thibault Saunier 2015-04-15 08:57:23 UTC
Review of attachment 301595 [details] [review]:

::: validate/tools/gst-validate-launcher.in
@@ +31,3 @@
         os.chdir(path)
         res = subprocess.check_output(['git', 'rev-list', '--max-parents=0', 'HEAD']).rstrip('\n')
+    except:

Would be better to also catch OSError instead of just accepting any exception.
Comment 3 Young Han Lee 2015-04-15 09:23:58 UTC
Created attachment 301599 [details] [review]
Handle git error properly

patch #2

Thibault, thanks for review.
Comment 4 Thibault Saunier 2015-04-15 09:37:25 UTC
Thanks for your patch!
Comment 5 Thibault Saunier 2015-04-15 09:38:12 UTC
commit 102c13ed6ffa71fc0360da5694789bf1a6fca6fa
Author: Young Han Lee <y.lee@lge.com>
Date:   Wed Apr 15 14:02:32 2015 +0900

    validate:launcher: Handle git error properly
    
    'OSError' exception is emitted but not handled properly when git is not
    installed on running system.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747892