new patchset posted,
thanks for feedback

​Best regards,​

Jiri Prochazka 
LNST Developer 
+420 532 294 633 | jprochaz@redhat.com
Red Hat Czech | Purkyňova 71/99, 612 00 Brno

2015-08-25 11:56 GMT+02:00 Jan Tluka <jtluka@redhat.com>:
Mon, Aug 24, 2015 at 01:49:41PM CEST, jprochaz@redhat.com wrote:
>This method is used for detecting if program is present in $PATH
>
>Signed-off-by: Jiri Prochazka <jprochaz@redhat.com>
>---
> lnst/Common/Utils.py | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
>diff --git a/lnst/Common/Utils.py b/lnst/Common/Utils.py
>index c283b99..d198b6f 100644
>--- a/lnst/Common/Utils.py
>+++ b/lnst/Common/Utils.py
>@@ -263,3 +263,16 @@ def std_deviation(values):
>         s1 += val
>         s2 += val**2
>     return (math.sqrt(len(values)*s2 - s1**2))/len(values)
>+
>+def is_installed(program):
>+    """
>+    Returns True if program is detected by which, False otherwise
>+    """
>+    cmd = "which %s" % program
>+    process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE,
>+                               stderr=subprocess.PIPE)
>+    output = process.communicate()[0]

I think this is too complicated. Also you save output but it's never
used. Check if you can use simpler functions from the module as
.check_call() or .call().

>+    if process.returncode == 0:
>+        return True
>+    else:
>+        return False
>--
>2.4.3
>
>_______________________________________________
>LNST-developers mailing list
>LNST-developers@lists.fedorahosted.org
>https://lists.fedorahosted.org/mailman/listinfo/lnst-developers