forked from pool/python-redfish
- Update to 2.1.5:
* Removed urlparse2 dependency * Updated jsonpatch requirements; jsonpatch 1.25 dropped Python 3.4 support - Dropped patch 0001-remove-urlparse2-dependncy.patch, now included OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-redfish?expand=0&rev=3
This commit is contained in:
@@ -1,130 +0,0 @@
|
||||
From 953e3bd640b79ff621ba2b4cc7215581916ddb99 Mon Sep 17 00:00:00 2001
|
||||
From: Bill Dodd <billdodd@gmail.com>
|
||||
Date: Wed, 29 Jan 2020 17:18:25 -0600
|
||||
Subject: [PATCH] remove urlparse2 dependncy
|
||||
|
||||
---
|
||||
requirements.txt | 4 ++--
|
||||
setup.py | 12 +++++++++---
|
||||
src/redfish/ris/rmc_helper.py | 5 +++--
|
||||
tests/ris/test_rmc_helper.py | 29 +++++++++++++++++++++++++++++
|
||||
tox.ini | 8 ++++++++
|
||||
5 files changed, 51 insertions(+), 7 deletions(-)
|
||||
create mode 100644 tests/ris/test_rmc_helper.py
|
||||
|
||||
diff --git a/requirements.txt b/requirements.txt
|
||||
index 060d85f..fba487f 100644
|
||||
--- a/requirements.txt
|
||||
+++ b/requirements.txt
|
||||
@@ -1,4 +1,4 @@
|
||||
-jsonpatch
|
||||
+jsonpatch<=1.24 ; python_version == '3.4'
|
||||
+jsonpatch ; python_version >= '3.5' or python_version == '2.7'
|
||||
jsonpath_rw
|
||||
jsonpointer
|
||||
-urlparse2
|
||||
\ No newline at end of file
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 344e597..c5ea3b7 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -24,8 +24,14 @@ setup(name='redfish',
|
||||
packages=find_packages('src'),
|
||||
package_dir={'': 'src'},
|
||||
install_requires=[
|
||||
- 'jsonpatch',
|
||||
'jsonpath_rw',
|
||||
'jsonpointer',
|
||||
- 'urlparse2',
|
||||
- ])
|
||||
+ ],
|
||||
+ extras_require={
|
||||
+ ':python_version == "3.4"': [
|
||||
+ 'jsonpatch<=1.24'
|
||||
+ ],
|
||||
+ ':python_version >= "3.5" or python_version == "2.7"': [
|
||||
+ 'jsonpatch'
|
||||
+ ]
|
||||
+ })
|
||||
diff --git a/src/redfish/ris/rmc_helper.py b/src/redfish/ris/rmc_helper.py
|
||||
index e633a49..5e7b5dc 100644
|
||||
--- a/src/redfish/ris/rmc_helper.py
|
||||
+++ b/src/redfish/ris/rmc_helper.py
|
||||
@@ -12,9 +12,10 @@ import json
|
||||
import errno
|
||||
import logging
|
||||
import hashlib
|
||||
-import urlparse2
|
||||
import redfish.rest
|
||||
|
||||
+from six.moves.urllib.parse import urlparse
|
||||
+
|
||||
from .ris import (RisMonolith)
|
||||
from .sharedtypes import (JSONEncoder)
|
||||
from .config import (AutoConfigParser)
|
||||
@@ -146,7 +147,7 @@ class RmcClient(object):
|
||||
|
||||
def get_cache_dirname(self):
|
||||
"""The rest client's current base URL converted to path"""
|
||||
- parts = urlparse2.urlparse(self.get_base_url())
|
||||
+ parts = urlparse(self.get_base_url())
|
||||
pathstr = '%s/%s' % (parts.netloc, parts.path)
|
||||
return pathstr.replace('//', '/')
|
||||
|
||||
diff --git a/tests/ris/test_rmc_helper.py b/tests/ris/test_rmc_helper.py
|
||||
new file mode 100644
|
||||
index 0000000..dbf4a29
|
||||
--- /dev/null
|
||||
+++ b/tests/ris/test_rmc_helper.py
|
||||
@@ -0,0 +1,29 @@
|
||||
+# Copyright Notice:
|
||||
+# Copyright 2020 DMTF. All rights reserved.
|
||||
+# License: BSD 3-Clause License. For full text see link:
|
||||
+# https://github.com/DMTF/Redfish-Protocol-Validator/blob/master/LICENSE.md
|
||||
+
|
||||
+import unittest
|
||||
+try:
|
||||
+ from unittest import mock
|
||||
+except ImportError:
|
||||
+ import mock
|
||||
+
|
||||
+from redfish.ris import rmc_helper
|
||||
+
|
||||
+
|
||||
+class RmcHelper(unittest.TestCase):
|
||||
+ def setUp(self):
|
||||
+ super(RmcHelper, self).setUp()
|
||||
+
|
||||
+ @mock.patch('redfish.rest.v1.HttpClient')
|
||||
+ def test_get_cache_dirname(self, mock_http_client):
|
||||
+ url = 'http://example.com'
|
||||
+ helper = rmc_helper.RmcClient(url=url, username='oper', password='xyz')
|
||||
+ mock_http_client.return_value.get_base_url.return_value = url
|
||||
+ dir_name = helper.get_cache_dirname()
|
||||
+ self.assertEqual(dir_name, 'example.com/')
|
||||
+
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ unittest.main()
|
||||
diff --git a/tox.ini b/tox.ini
|
||||
index 986f141..b1b8a84 100644
|
||||
--- a/tox.ini
|
||||
+++ b/tox.ini
|
||||
@@ -14,6 +14,14 @@ commands =
|
||||
--with-timer \
|
||||
--with-coverage --cover-erase --cover-package=src
|
||||
|
||||
+[testenv:py27]
|
||||
+deps =
|
||||
+ coverage
|
||||
+ fixtures
|
||||
+ mock
|
||||
+ nose
|
||||
+ nose-timer
|
||||
+
|
||||
[testenv:pep8]
|
||||
basepython = python3.6
|
||||
deps = flake8
|
||||
--
|
||||
2.25.0
|
||||
|
@@ -1,3 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 19 05:02:34 UTC 2020 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Update to 2.1.5:
|
||||
* Removed urlparse2 dependency
|
||||
* Updated jsonpatch requirements; jsonpatch 1.25 dropped Python 3.4 support
|
||||
- Dropped patch 0001-remove-urlparse2-dependncy.patch, now included
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 30 21:40:14 UTC 2020 - Martin Hauke <mardnh@gmx.de>
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
#
|
||||
# spec file for package python-redfish
|
||||
#
|
||||
# Copyright (c) 2020 SUSE LLC
|
||||
# Copyright (c) 2020, Martin Hauke <mardnh@gmx.de>
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
@@ -12,19 +13,19 @@
|
||||
# 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/
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-redfish
|
||||
Version: 2.1.4
|
||||
Version: 2.1.5
|
||||
Release: 0
|
||||
Summary: Redfish Python Library
|
||||
License: BSD-3-Clause
|
||||
Group: Development/Languages/Python
|
||||
URL: https://github.com/DMTF/python-redfish-library
|
||||
Source: https://github.com/DMTF/python-redfish-library/archive/%{version}.tar.gz#/redfish-%{version}.tar.gz
|
||||
Patch0: 0001-remove-urlparse2-dependncy.patch
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
@@ -48,7 +49,6 @@ the Engine of Application State) Redfish architecture.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-library-%{version}
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
%python_build
|
||||
|
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d03909a0b36f668a89f9ca5742d094c4a7d373890e63dd2ff6b98ef4e3fecaa2
|
||||
size 37435
|
3
redfish-2.1.5.tar.gz
Normal file
3
redfish-2.1.5.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b8f0314d9bee3fafc9f200b390e48b67e215ad65db9d0c86bdb678c990a68af8
|
||||
size 37864
|
Reference in New Issue
Block a user