Hello community,

here is the log from the commit of package python-osc-lib for openSUSE:Factory 
checked in at 2019-03-06 15:51:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-osc-lib (Old)
 and      /work/SRC/openSUSE:Factory/.python-osc-lib.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-osc-lib"

Wed Mar  6 15:51:05 2019 rev:8 rq:682050 version:1.11.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-osc-lib/python-osc-lib.changes    
2018-09-07 15:38:39.886583743 +0200
+++ /work/SRC/openSUSE:Factory/.python-osc-lib.new.28833/python-osc-lib.changes 
2019-03-06 15:51:39.604432735 +0100
@@ -1,0 +2,6 @@
+Wed Mar  6 08:57:16 UTC 2019 - Thomas Bechtold <tbecht...@suse.com>
+
+- add 0001-Fix-formatter-handling-for-python-3.7.patch (bsc#1127954)
+  Fix openstack client for python 3.7
+
+-------------------------------------------------------------------

New:
----
  0001-Fix-formatter-handling-for-python-3.7.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-osc-lib.spec ++++++
--- /var/tmp/diff_new_pack.xCPRIb/_old  2019-03-06 15:51:42.644432123 +0100
+++ /var/tmp/diff_new_pack.xCPRIb/_new  2019-03-06 15:51:42.648432123 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-osc-lib
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,7 +12,7 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -24,6 +24,8 @@
 Group:          Development/Languages/Python
 URL:            https://docs.openstack.org/developer/osc-lib
 Source0:        
https://files.pythonhosted.org/packages/source/o/osc-lib/osc-lib-1.11.1.tar.gz
+# https://review.openstack.org/#/c/618137/
+Patch1:         0001-Fix-formatter-handling-for-python-3.7.patch
 BuildRequires:  openstack-macros
 BuildRequires:  python-devel
 BuildRequires:  python2-Babel >= 2.3.4

++++++ 0001-Fix-formatter-handling-for-python-3.7.patch ++++++
>From 72fbf45ed15a1b4c8111cac9f4446289ca187b0d Mon Sep 17 00:00:00 2001
From: Rabi Mishra <ramis...@redhat.com>
Date: Thu, 15 Nov 2018 16:57:22 +0530
Subject: [PATCH] Fix formatter handling for python 3.7

Calling issubclass() on a python function fails in Python 3.7.

Change-Id: Id2abfaad6ed96532157b9bc7b2124e6f6ad37511
Story: #2003322
Task: 27942
---
 osc_lib/utils/__init__.py | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/osc_lib/utils/__init__.py b/osc_lib/utils/__init__.py
index d640ca8..f3573c7 100644
--- a/osc_lib/utils/__init__.py
+++ b/osc_lib/utils/__init__.py
@@ -430,9 +430,10 @@ def get_dict_properties(item, fields, 
mixed_case_fields=None, formatters=None):
         data = item[field_name] if field_name in item else ''
         if field in formatters:
             formatter = formatters[field]
-            if issubclass(formatter, cliff_columns.FormattableColumn):
+            if (isinstance(formatter, type) and issubclass(
+                    formatter, cliff_columns.FormattableColumn)):
                 data = formatter(data)
-            else:
+            elif callable(formatter):
                 warnings.warn(
                     'The usage of formatter functions is now discouraged. '
                     'Consider using cliff.columns.FormattableColumn instead. '
@@ -440,6 +441,10 @@ def get_dict_properties(item, fields, 
mixed_case_fields=None, formatters=None):
                     category=DeprecationWarning)
                 if data is not None:
                     data = formatter(data)
+            else:
+                msg = "Invalid formatter provided."
+                raise exceptions.CommandError(msg)
+
         row.append(data)
     return tuple(row)
 
@@ -492,9 +497,10 @@ def get_item_properties(item, fields, 
mixed_case_fields=None, formatters=None):
         data = getattr(item, field_name, '')
         if field in formatters:
             formatter = formatters[field]
-            if issubclass(formatter, cliff_columns.FormattableColumn):
+            if (isinstance(formatter, type) and issubclass(
+                    formatter, cliff_columns.FormattableColumn)):
                 data = formatter(data)
-            else:
+            elif callable(formatter):
                 warnings.warn(
                     'The usage of formatter functions is now discouraged. '
                     'Consider using cliff.columns.FormattableColumn instead. '
@@ -502,6 +508,10 @@ def get_item_properties(item, fields, 
mixed_case_fields=None, formatters=None):
                     category=DeprecationWarning)
                 if data is not None:
                     data = formatter(data)
+            else:
+                msg = "Invalid formatter provided."
+                raise exceptions.CommandError(msg)
+
         row.append(data)
     return tuple(row)
 
-- 
2.21.0


Reply via email to