Discussion:
[Libstoragemgmt-devel] [PATCH 1/2] plugin_test.py: Remove requirement for PyYAML
Tony Asleson
2014-12-11 19:39:39 UTC
Permalink
It's now optional

Signed-off-by: Tony Asleson <***@redhat.com>
---
configure.ac | 1 -
test/plugin_test.py | 12 ++++++++----
2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0bd3070..1c27fa0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -160,7 +160,6 @@ AM_PATH_PYTHON([2.6], [], AC_MSG_ERROR([Python interpreter 2.6 or 2.7 required])
AC_PYTHON_MODULE([pywbem], [Required])
AC_PYTHON_MODULE([M2Crypto], [Required])
AC_PYTHON_MODULE([argparse], [Required])
-AC_PYTHON_MODULE([yaml], [Required])

dnl ==========================================================================
dnl Check for libmicrohttpd and json-c as it is needed for REST API daemon
diff --git a/test/plugin_test.py b/test/plugin_test.py
index e92497c..8e0d8bc 100755
--- a/test/plugin_test.py
+++ b/test/plugin_test.py
@@ -26,7 +26,6 @@ import argparse
import collections
import atexit
import sys
-import yaml
import re
import os
import tempfile
@@ -1273,10 +1272,15 @@ def dump_results():
unittest.main exits when done so we need to register this handler to
get our results out.

- output details (yaml) results of what we called, how it finished and how
- long it took.
+ If PyYAML is available we will output detailed results, else we will
+ output nothing. The detailed output results of what we called,
+ how it finished and how long it took.
"""
- sys.stdout.write(yaml.dump(dict(methods_called=results, stats=stats)))
+ try:
+ import yaml
+ sys.stdout.write(yaml.dump(dict(methods_called=results, stats=stats)))
+ except ImportError:
+ sys.stdout.write("NOTICE: Install PyYAML for detailed test results\n")


def add_our_params():
--
1.8.2.1
Tony Asleson
2014-12-11 19:39:40 UTC
Permalink
Signed-off-by: Tony Asleson <***@redhat.com>
---
packaging/libstoragemgmt.spec.in | 2 --
1 file changed, 2 deletions(-)

diff --git a/packaging/libstoragemgmt.spec.in b/packaging/libstoragemgmt.spec.in
index 118f0a7..d787e72 100644
--- a/packaging/libstoragemgmt.spec.in
+++ b/packaging/libstoragemgmt.spec.in
@@ -52,11 +52,9 @@ BuildRequires: glib2-devel
BuildRequires: gcc-c++
%if 0%{?suse_version}
BuildRequires: libyajl-devel
-BuildRequires: python-PyYAML
%else
# Fedora RHEL
BuildRequires: yajl-devel
-BuildRequires: PyYAML
%endif

%if 0%{?do_fdupes}
--
1.8.2.1
Loading...