diff --git a/.zuul.yaml b/.zuul.yaml index 8bbd77ba3283cd232a6457da165c20f282395479..9353112afe34e75acbd9762dd850c3730ca2e487 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -2,8 +2,7 @@ templates: - check-requirements - openstack-lower-constraints-jobs - - openstack-python-jobs - - openstack-python3-train-jobs + - openstack-python3-wallaby-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 check: diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 654c8a6a325c288cc349f72f9daa17455696201e..60dd544be5b652b59d49dd5053f9e2d67331380d 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -1,17 +1,19 @@ -If you would like to contribute to the development of OpenStack, you must -follow the steps in this page: +The source repository for this project can be found at: - https://docs.openstack.org/infra/manual/developers.html + https://opendev.org/openstack/python-freezerclient -If you already have a good understanding of how the system works and your -OpenStack accounts are set up, you can skip to the development workflow -section of this documentation to learn how changes to OpenStack should be -submitted for review via the Gerrit tool: +Pull requests submitted through GitHub are not monitored. - https://docs.openstack.org/infra/manual/developers.html#development-workflow +To start contributing to OpenStack, follow the steps in the contribution guide +to set up and use Gerrit: -Pull requests submitted through GitHub will be ignored. + https://docs.openstack.org/contributors/code-and-documentation/quick-start.html -Bugs should be filed on Storyboard, not GitHub: +Bugs should be filed on Storyboard: https://storyboard.openstack.org/#!/project/openstack/python-freezerclient + +For more specific information about contributing to this repository, see the +python-freezerclient contributor guide: + + https://docs.openstack.org/python-freezerclient/latest/contributor/contributing.html diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000000000000000000000000000000000000..25fa0e377a3c566295eff5929a479f3fd74a76c4 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,77 @@ +python-freezerclient (4.3.0-2) UNRELEASED; urgency=medium + + * Bump debhelper from old 11 to 13. + + Drop check for DEB_BUILD_OPTIONS containing "nocheck", since debhelper now + does this. + + Replace python_distutils buildsystem with pybuild. + * Set upstream metadata fields: Repository, Repository-Browse. + * Update standards version to 4.5.1, no changes needed. + * Remove Section on python3-freezerclient that duplicates source. + + -- Debian Janitor Mon, 20 Sep 2021 14:59:20 -0000 + +python-freezerclient (4.3.0-1) experimental; urgency=medium + + * New upstream release. + + -- Thomas Goirand Mon, 20 Sep 2021 16:23:44 +0200 + +python-freezerclient (4.2.0-2) unstable; urgency=medium + + * Upload to unstable. + + -- Thomas Goirand Mon, 16 Aug 2021 10:49:55 +0200 + +python-freezerclient (4.2.0-1) experimental; urgency=medium + + * New upstream release. + * debhelper-compat 11. + + -- Thomas Goirand Thu, 25 Mar 2021 14:36:00 +0100 + +python-freezerclient (4.0.0-2) unstable; urgency=medium + + * Uploading to unstable. + * Fixed debian/watch. + * Add a debian/salsa-ci.yml. + + -- Thomas Goirand Fri, 16 Oct 2020 12:07:25 +0200 + +python-freezerclient (4.0.0-1) experimental; urgency=medium + + * New upstream release. + * Added python3-isort as build-depends. + + -- Thomas Goirand Mon, 14 Sep 2020 22:31:23 +0200 + +python-freezerclient (3.1.0-1) experimental; urgency=medium + + * New upstream release. + * Removed python3-mock from build-depends. + + -- Thomas Goirand Sun, 13 Sep 2020 16:33:01 +0200 + +python-freezerclient (3.0.1-2) unstable; urgency=medium + + * Uploading to unstable. + + -- Thomas Goirand Fri, 08 May 2020 23:01:13 +0200 + +python-freezerclient (3.0.1-1) experimental; urgency=medium + + * New upstream release. + * Add python3-astroid as build-depends. + + -- Thomas Goirand Sat, 11 Apr 2020 22:23:28 +0200 + +python-freezerclient (2.2.0-2) unstable; urgency=medium + + * Rebuilt source-only. + + -- Thomas Goirand Thu, 09 Jan 2020 13:24:48 +0100 + +python-freezerclient (2.2.0-1) unstable; urgency=medium + + * Initial release (Closes: #945519). + + -- Michal Arbet Wed, 27 Nov 2019 11:07:34 +0100 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000000000000000000000000000000000000..a0e2441d2ea9dbb00eda7060ec81ba2af54887d8 --- /dev/null +++ b/debian/control @@ -0,0 +1,67 @@ +Source: python-freezerclient +Section: python +Priority: optional +Maintainer: Debian OpenStack +Uploaders: + Michal Arbet , + Thomas Goirand , +Build-Depends: + debhelper-compat (= 13), + dh-python, + openstack-pkg-tools, + python3-all, + python3-pbr, + python3-setuptools, + python3-sphinx, +Build-Depends-Indep: + python3-astroid, + python3-cliff, + python3-isort, + python3-keystoneauth1, + python3-openstackdocstheme, + python3-oslo.serialization, + python3-oslo.utils, + python3-stestr, + python3-testtools, +Standards-Version: 4.5.1 +Vcs-Git: https://salsa.debian.org/openstack-team/clients/python-freezerclient.git +Vcs-Browser: https://salsa.debian.org/openstack-team/clients/python-freezerclient +Homepage: https://github.com/openstack/python-freezerclient.git + +Package: python3-freezerclient +Architecture: all +Depends: + python3-cliff, + python3-keystoneauth1, + python3-oslo.serialization, + python3-oslo.utils, + python3-setuptools, + ${misc:Depends}, + ${python3:Depends}, +Description: OpenStack backup restore and disaster recovery service - client files + Freezer is a distributed backup restore and disaster recovery as a service + platform. It is designed to be multi OS (Linux, Windows, OSX, *BSD), focused + on providing efficiency and flexibility for block based backups, file based + incremental backups, point-in-time actions, jobs synchronization (i.e. + backup synchronization over multiple nodes) and many other features. + It is aimed at being useful for all environments, including large + ephemeral Clouds. + . + This package contains the Python 3.x module. + +Package: python-freezerclient-doc +Section: doc +Architecture: all +Depends: + ${misc:Depends}, + ${sphinxdoc:Depends}, +Description: OpenStack backup restore and disaster recovery service - doc files + Freezer is a distributed backup restore and disaster recovery as a service + platform. It is designed to be multi OS (Linux, Windows, OSX, *BSD), focused + on providing efficiency and flexibility for block based backups, file based + incremental backups, point-in-time actions, jobs synchronization (i.e. + backup synchronization over multiple nodes) and many other features. + It is aimed at being useful for all environments, including large + ephemeral Clouds. + . + This package contains the documentation. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000000000000000000000000000000000000..ca7bd60665d9d81bceae6fa6af631cda5185efb1 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,30 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: python-freezerclient +Source: https://github.com/openstack/python-freezerclient.git + +Files: * +Copyright: (c) 2014-2016, Hewlett-Packard Development Company, L.P. + (c) 2018, ZTE Corporation + (c) 2012,OpenStack Foundation +License: Apache-2 + +Files: debian/* +Copyright: (c) 2018, Ultimum Technologies s. r. o. + (c) 2018, Michal Arbet +License: Apache-2 + +License: Apache-2 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian-based systems the full text of the Apache version 2.0 license + can be found in `/usr/share/common-licenses/Apache-2.0'. diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000000000000000000000000000000000000..adedfb425d619d9461c6750c092f4c63b2cda562 --- /dev/null +++ b/debian/rules @@ -0,0 +1,31 @@ +#!/usr/bin/make -f + +include /usr/share/openstack-pkg-tools/pkgos.make + +%: + dh $@ --buildsystem=pybuild --with python3,sphinxdoc + + +override_dh_auto_build: + python3 setup.py build --force + +override_dh_auto_install: + pkgos-dh_auto_install --no-py2 + +override_dh_python3: + dh_python3 --shebang=/usr/bin/python3 + +override_dh_auto_test: + pkgos-dh_auto_test --no-py2 + +override_dh_auto_clean: + python3 setup.py clean + find . -iname '*.pyc' -delete + rm -rf build + rm -f ChangeLog AUTHORS + +override_dh_sphinxdoc: +ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS))) + python3 -m sphinx -b html doc/source $(CURDIR)/debian/python-freezerclient-doc/usr/share/doc/python-freezerclient-doc/html + dh_sphinxdoc -O--buildsystem=pybuild +endif diff --git a/debian/salsa-ci.yml b/debian/salsa-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..0c22dc4373420a05999d6f9bc2235f73fc0ffa14 --- /dev/null +++ b/debian/salsa-ci.yml @@ -0,0 +1,3 @@ +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000000000000000000000000000000000000..163aaf8d82b6c54f23c45f32895dbdfdcc27b047 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000000000000000000000000000000000000..cb61fa5267b6ad8b3bbc2a612754b79dae466292 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore = "^[^/]*[.]egg-info/" diff --git a/debian/upstream/metadata b/debian/upstream/metadata new file mode 100644 index 0000000000000000000000000000000000000000..fcafdedb5ea38c3e73e79e8eae0f80ecedae8dd5 --- /dev/null +++ b/debian/upstream/metadata @@ -0,0 +1,3 @@ +--- +Repository: https://github.com/openstack/python-freezerclient.git +Repository-Browse: https://github.com/openstack/python-freezerclient diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000000000000000000000000000000000000..6fb2c95380b0cea573854825fccf04e19149ebf6 --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts="uversionmangle=s/\.0rc/~rc/;s/\.0b1/~b1/;s/\.0b2/~b2/;s/\.0b3/~b3/" \ +https://github.com/openstack/python-freezerclient/tags .*/(\d[brc\d\.]+)\.tar\.gz diff --git a/doc/requirements.txt b/doc/requirements.txt index 84126a550a8da6166b6be95744db8ea375cad8e9..1489bcee5ab17472c9e7b67d0fe130a9d39386b7 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,4 +1,3 @@ -sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD -sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2;python_version>='3.4' # BSD -openstackdocstheme>=1.20.0 # Apache-2.0 -reno>=2.5.0 # Apache-2.0 +sphinx>=2.0.0,!=2.1.0 # BSD +openstackdocstheme>=2.2.1 # Apache-2.0 +reno>=3.1.0 # Apache-2.0 diff --git a/doc/source/conf.py b/doc/source/conf.py index 09da1c972ee7c7b64275a2b4d7c941c5048aa90c..7a326a6b0d1640b88245849f0a924239879a7007 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -46,9 +46,9 @@ master_doc = 'index' copyright = u'2016, OpenStack' # openstackdocstheme options -repository_name = 'openstack/python-freezerclient' -bug_project = 'freezer' -bug_tag = 'python-freezerclient' +openstackdocs_repo_name = 'openstack/python-freezerclient' +openstackdocs_bug_project = 'freezer' +openstackdocs_bug_tag = 'python-freezerclient' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -80,7 +80,7 @@ exclude_patterns = [] #show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'native' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] diff --git a/doc/source/contributor/contributing.rst b/doc/source/contributor/contributing.rst new file mode 100644 index 0000000000000000000000000000000000000000..56a3c3e3247476130d5c0a640b58f13bd8ca0e43 --- /dev/null +++ b/doc/source/contributor/contributing.rst @@ -0,0 +1,48 @@ +============================ +So You Want to Contribute... +============================ +For general information on contributing to OpenStack, please check out the +`contributor guide `_ to get started. +It covers all the basics that are common to all OpenStack projects: the accounts +you need, the basics of interacting with our Gerrit review system, how we +communicate as a community, etc. +Below will cover the more project specific information you need to get started +with python-freezerclient. + +Communication +~~~~~~~~~~~~~ +* IRC channel #openstack-freezer at OFTC +* Mailing list (prefix subjects with ``[freezer]`` for faster responses) + http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-discuss + +Contacting the Core Team +~~~~~~~~~~~~~~~~~~~~~~~~ +Please refer the `python-freezerclient Core Team +`_ contacts. + +New Feature Planning +~~~~~~~~~~~~~~~~~~~~ +python-freezerclient features are tracked on `Storyboard `_. + +Task Tracking +~~~~~~~~~~~~~ +We track our tasks in `Storyboard `_. +If you're looking for some smaller, easier work item to pick up and get started +on, search for the 'low-hanging-fruit' tag. + +Reporting a Bug +~~~~~~~~~~~~~~~ +You found an issue and want to make sure we are aware of it? You can do so on +`StoryBoard `_. + +Getting Your Patch Merged +~~~~~~~~~~~~~~~~~~~~~~~~~ +All changes proposed to the python-freezerclient project require one or two +2 votes +from python-freezerclient core reviewers before one of the core reviewers can approve +patch by giving ``Workflow +1`` vote. + +Project Team Lead Duties +~~~~~~~~~~~~~~~~~~~~~~~~ +All common PTL duties are enumerated in the `PTL guide +`_. + diff --git a/doc/source/contributor/index.rst b/doc/source/contributor/index.rst deleted file mode 100644 index 275c96529106899af3cf91f87e96a0655ea88be8..0000000000000000000000000000000000000000 --- a/doc/source/contributor/index.rst +++ /dev/null @@ -1,17 +0,0 @@ -=================== - Contributor Guide -=================== - -Code is hosted at `git.openstack.org`__. Submit bugs to the python-freezerclient -project on `Launchpad`__. Submit code to the `openstack/python-freezerclient` -project using `Gerrit`__. - -__ https://opendev.org/openstack/python-freezerclient -__ https://storyboard.openstack.org/#!/project/openstack/freezer-api -__ https://docs.openstack.org/infra/manual/developers.html#development-workflow - - -.. toctree:: - :maxdepth: 2 - - testing diff --git a/doc/source/contributor/testing.rst b/doc/source/contributor/testing.rst index 99a311dbe6e3d14898bc6a2a43d4288d3aa61098..2598d56f2bf301e4721ad55cdeba23af73f79540 100644 --- a/doc/source/contributor/testing.rst +++ b/doc/source/contributor/testing.rst @@ -6,11 +6,8 @@ test targets that can be run to validate the code. ``tox -e pep8`` Style guidelines enforcement. -``tox -e py27`` - Traditional unit testing (Python 2.7). - -``tox -e py35`` - Traditional unit testing (Python 3.5). +``tox -e py37`` + Traditional unit testing (Python 3.7). ``tox -e cover`` Generate a coverage report on unit testing. diff --git a/doc/source/index.rst b/doc/source/index.rst index 1512fa8b24c769c43eba8b46128906f98a2995fe..ac956152036b61e7fbeea320d78777163bacfb44 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -11,8 +11,16 @@ Contents user/index reference/index cli/index - contributor/index +For Contributors +================ + +* If you are a new contributor to python-freezerclient please refer: :doc:`contributor/contributing` + + .. toctree:: + :hidden: + + contributor/contributing Indices and tables ------------------ diff --git a/freezerclient/client.py b/freezerclient/client.py index 363fb42e7f64dca4235c6ee85062989b1561821c..1d5733fdd3ada384267c887b4c2157eac1a3d510 100644 --- a/freezerclient/client.py +++ b/freezerclient/client.py @@ -19,7 +19,7 @@ import os def Client(version=None, endpoint=None, username=None, password=None, project_name=None, auth_url=None, project_id=None, token=None, cacert=None, project_domain_name=None, user_domain_id=None, - user_domain_name=None, **kwargs): + user_domain_name=None, project_domain_id=None, **kwargs): """Initialize client object based on given version. HOW-TO: @@ -70,6 +70,11 @@ def Client(version=None, endpoint=None, username=None, password=None, if project_domain_name: kwargs["project_domain_name"] = project_domain_name + if project_domain_id: + kwargs["project_domain_id"] = project_domain_id + else: + kwargs["project_domain_id"] = os.environ.get('OS_PROJECT_DOMAIN_ID') + if user_domain_name: kwargs["user_domain_name"] = user_domain_name else: diff --git a/freezerclient/shell.py b/freezerclient/shell.py index 0bf22dfe90cfc2f30c43ac3baa97757334aab757..d89bb9ca4646860f7ea92026c1f978d505af5093 100644 --- a/freezerclient/shell.py +++ b/freezerclient/shell.py @@ -158,14 +158,14 @@ class FreezerShell(app.App): dest='os_project_domain_id', default=os.environ.get('OS_PROJECT_DOMAIN_ID'), help='OpenStack project domain ID. ' - 'Defaults to env[OS_PROJECT_ID].' + 'Defaults to env[OS_PROJECT_DOMAIN_ID].' ) parser.add_argument( '--os-project-name', dest='os_project_name', default=os.environ.get('OS_PROJECT_NAME'), - help='Project name to scope to' + help='Project name (tenant name)' ) parser.add_argument( @@ -236,7 +236,6 @@ class FreezerShell(app.App): 'token': self.options.os_token, 'username': self.options.os_username, 'password': self.options.os_password, - 'tenant_name': self.options.os_project_name, 'auth_url': self.options.os_auth_url, 'endpoint': self.options.os_backup_url, 'endpoint_type': self.options.os_endpoint_type, diff --git a/freezerclient/tests/unit/test_client.py b/freezerclient/tests/unit/test_client.py index 58adf964ecc0f751b6dd83c8b5a7c8281c0b8d5d..55a76ebdbb3636d23b8b237cf58dac9d4d59d25e 100644 --- a/freezerclient/tests/unit/test_client.py +++ b/freezerclient/tests/unit/test_client.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock import unittest +from unittest import mock from freezerclient import client from freezerclient import v1 diff --git a/freezerclient/tests/unit/test_shell.py b/freezerclient/tests/unit/test_shell.py index c1b825f59f241396f8c65815c55f5a3bb67aa34c..214f2064a075db46ea654e3387adb6137fbe6599 100644 --- a/freezerclient/tests/unit/test_shell.py +++ b/freezerclient/tests/unit/test_shell.py @@ -17,7 +17,7 @@ import re import sys import fixtures -import six +import io import testtools from testtools import matchers @@ -36,8 +36,6 @@ class ShellTest(testtools.TestCase): FAKE_ENV = { 'OS_USERNAME': DEFAULT_USERNAME, 'OS_PASSWORD': DEFAULT_PASSWORD, - 'OS_TENANT_ID': DEFAULT_PROJECT_ID, - 'OS_TENANT_NAME': DEFAULT_PROJECT_NAME, 'OS_PROJECT_ID': DEFAULT_PROJECT_ID, 'OS_PROJECT_NAME': DEFAULT_PROJECT_NAME, 'OS_AUTH_URL': DEFAULT_AUTH_URL, @@ -58,8 +56,8 @@ class ShellTest(testtools.TestCase): clean_env = {} _old_env, os.environ = os.environ, clean_env.copy() try: - sys.stdout = six.moves.cStringIO() - sys.stderr = six.moves.cStringIO() + sys.stdout = io.StringIO() + sys.stderr = io.StringIO() _shell = openstack_shell.FreezerShell() _shell.run(argstr.split()) except SystemExit: diff --git a/freezerclient/tests/unit/v1/test_client.py b/freezerclient/tests/unit/v1/test_client.py index 6471b355840d31a733f06b34419bdda2f6555658..ed12ed3c159e452757a53a07144fb52f0cf5c09d 100644 --- a/freezerclient/tests/unit/v1/test_client.py +++ b/freezerclient/tests/unit/v1/test_client.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from keystoneauth1 import loading as kaloading @@ -41,7 +40,7 @@ class TestClientMock(unittest.TestCase): kwargs = {'token': 'alpha', 'username': 'bravo', 'password': 'charlie', - 'tenant_name': 'delta', + 'project_name': 'delta', 'auth_url': 'echo', 'endpoint': 'golf', 'session': mock_session} @@ -50,7 +49,7 @@ class TestClientMock(unittest.TestCase): self.assertEqual('alpha', c.opts.os_token) self.assertEqual('bravo', c.opts.os_username) self.assertEqual('charlie', c.opts.os_password) - self.assertEqual('delta', c.opts.os_tenant_name) + self.assertEqual('delta', c.opts.os_project_name) self.assertEqual('echo', c.opts.os_auth_url) self.assertEqual(mock_session, c._session) self.assertEqual(mock_session, c.session) @@ -64,7 +63,6 @@ class TestClientMock(unittest.TestCase): mock_ks_loader.return_value.load_from_options.return_value = 'auth' kwargs = {'auth_url': 'one', 'project_id': 'two', - 'tenant_name': 'three', 'project_name': 'four', 'user_domain_id': 'five', 'user_domain_name': 'six', @@ -77,7 +75,6 @@ class TestClientMock(unittest.TestCase): self.assertIsInstance(c, client.Client) self.assertEqual('one', c.opts.os_auth_url) self.assertEqual('two', c.opts.os_project_id) - self.assertEqual('three', c.opts.os_tenant_name) self.assertEqual('four', c.opts.os_project_name) self.assertEqual('five', c.opts.os_user_domain_id) self.assertEqual('six', c.opts.os_user_domain_name) @@ -95,7 +92,6 @@ class TestClientMock(unittest.TestCase): mock_ks_loader.return_value.load_from_options.return_value = 'auth' kwargs = {'auth_url': 'one', 'project_id': 'two', - 'tenant_name': 'three', 'project_name': 'four', 'user_domain_id': 'five', 'user_domain_name': 'six', @@ -107,7 +103,6 @@ class TestClientMock(unittest.TestCase): self.assertIsInstance(c, client.Client) self.assertEqual('one', c.opts.os_auth_url) self.assertEqual('two', c.opts.os_project_id) - self.assertEqual('three', c.opts.os_tenant_name) self.assertEqual('four', c.opts.os_project_name) self.assertEqual('five', c.opts.os_user_domain_id) self.assertEqual('six', c.opts.os_user_domain_name) diff --git a/freezerclient/tests/unit/v1/test_client_actions.py b/freezerclient/tests/unit/v1/test_client_actions.py index 6265168c24141fe0ca4fcd7239823056754ad010..879790d0928c579a6be8083715043c6955b4da19 100644 --- a/freezerclient/tests/unit/v1/test_client_actions.py +++ b/freezerclient/tests/unit/v1/test_client_actions.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from freezerclient import exceptions from freezerclient.v1.managers import actions diff --git a/freezerclient/tests/unit/v1/test_client_backups.py b/freezerclient/tests/unit/v1/test_client_backups.py index 5001550bb864a4a0164e2b2ad479bafe97be5260..d0bd380811846b319d99cecd17a8ea94879a4a97 100644 --- a/freezerclient/tests/unit/v1/test_client_backups.py +++ b/freezerclient/tests/unit/v1/test_client_backups.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from freezerclient import exceptions from freezerclient.v1.managers import backups diff --git a/freezerclient/tests/unit/v1/test_client_clients.py b/freezerclient/tests/unit/v1/test_client_clients.py index 6d6c1f1b945af5a5ab9adbd8c137b6d0cb3880df..d8b8f259dddf39dce5ab62938934811881f0a43f 100644 --- a/freezerclient/tests/unit/v1/test_client_clients.py +++ b/freezerclient/tests/unit/v1/test_client_clients.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from freezerclient import exceptions from freezerclient.v1.managers import clients diff --git a/freezerclient/tests/unit/v1/test_client_jobs.py b/freezerclient/tests/unit/v1/test_client_jobs.py index c1c5d4352480ee8b707a90f9418086ea0c739088..550df00061be99a3a559dcf8c257fbe4450a8b72 100644 --- a/freezerclient/tests/unit/v1/test_client_jobs.py +++ b/freezerclient/tests/unit/v1/test_client_jobs.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from oslo_serialization import jsonutils as json diff --git a/freezerclient/tests/unit/v1/test_client_sessions.py b/freezerclient/tests/unit/v1/test_client_sessions.py index 2a83cef90b13c794331fb0626cfcf2d78b150992..f6775ad1f7d87499f2fcac19c97ceee56f51b3d9 100644 --- a/freezerclient/tests/unit/v1/test_client_sessions.py +++ b/freezerclient/tests/unit/v1/test_client_sessions.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from oslo_serialization import jsonutils as json diff --git a/freezerclient/tests/unit/v2/test_client.py b/freezerclient/tests/unit/v2/test_client.py index 1ecf1b1a9077517ecf4901ca90cf7fe94e93f297..461de0e56cb407a4431e68ade624f3194e58f798 100644 --- a/freezerclient/tests/unit/v2/test_client.py +++ b/freezerclient/tests/unit/v2/test_client.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from keystoneauth1 import loading as kaloading @@ -41,7 +40,7 @@ class TestClientMock(unittest.TestCase): kwargs = {'token': 'alpha', 'username': 'bravo', 'password': 'charlie', - 'tenant_name': 'delta', + 'project_name': 'delta', 'auth_url': 'echo', 'endpoint': 'golf', 'session': mock_session} @@ -50,7 +49,7 @@ class TestClientMock(unittest.TestCase): self.assertEqual('alpha', c.opts.os_token) self.assertEqual('bravo', c.opts.os_username) self.assertEqual('charlie', c.opts.os_password) - self.assertEqual('delta', c.opts.os_tenant_name) + self.assertEqual('delta', c.opts.os_project_name) self.assertEqual('echo', c.opts.os_auth_url) self.assertEqual(mock_session, c._session) self.assertEqual(mock_session, c.session) @@ -64,7 +63,6 @@ class TestClientMock(unittest.TestCase): mock_ks_loader.return_value.load_from_options.return_value = 'auth' kwargs = {'auth_url': 'one', 'project_id': 'two', - 'tenant_name': 'three', 'project_name': 'four', 'user_domain_id': 'five', 'user_domain_name': 'six', @@ -77,7 +75,6 @@ class TestClientMock(unittest.TestCase): self.assertIsInstance(c, client.Client) self.assertEqual('one', c.opts.os_auth_url) self.assertEqual('two', c.opts.os_project_id) - self.assertEqual('three', c.opts.os_tenant_name) self.assertEqual('four', c.opts.os_project_name) self.assertEqual('five', c.opts.os_user_domain_id) self.assertEqual('six', c.opts.os_user_domain_name) @@ -95,7 +92,6 @@ class TestClientMock(unittest.TestCase): mock_ks_loader.return_value.load_from_options.return_value = 'auth' kwargs = {'auth_url': 'one', 'project_id': 'two', - 'tenant_name': 'three', 'project_name': 'four', 'user_domain_id': 'five', 'user_domain_name': 'six', @@ -107,7 +103,6 @@ class TestClientMock(unittest.TestCase): self.assertIsInstance(c, client.Client) self.assertEqual('one', c.opts.os_auth_url) self.assertEqual('two', c.opts.os_project_id) - self.assertEqual('three', c.opts.os_tenant_name) self.assertEqual('four', c.opts.os_project_name) self.assertEqual('five', c.opts.os_user_domain_id) self.assertEqual('six', c.opts.os_user_domain_name) diff --git a/freezerclient/tests/unit/v2/test_client_actions.py b/freezerclient/tests/unit/v2/test_client_actions.py index 346ce81c9114c662c4f2ec67bf8fd50f21801a23..f6852787cb5af702ed73b7a03214b6cb373f7c7a 100644 --- a/freezerclient/tests/unit/v2/test_client_actions.py +++ b/freezerclient/tests/unit/v2/test_client_actions.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from freezerclient import exceptions from freezerclient.v2.managers import actions diff --git a/freezerclient/tests/unit/v2/test_client_backups.py b/freezerclient/tests/unit/v2/test_client_backups.py index 6cfd6740d11823df1d75ad9e8b6aeb2db4d79982..e362a69c0c5d0e938298a1672e5b0826d2e8e334 100644 --- a/freezerclient/tests/unit/v2/test_client_backups.py +++ b/freezerclient/tests/unit/v2/test_client_backups.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from freezerclient import exceptions from freezerclient.v2.managers import backups diff --git a/freezerclient/tests/unit/v2/test_client_clients.py b/freezerclient/tests/unit/v2/test_client_clients.py index 4bea1acffe7317914946b3cef8ed9295f57561f1..a3cc8b0e1e6d9931451cf9dd88681226ac2ebd1e 100644 --- a/freezerclient/tests/unit/v2/test_client_clients.py +++ b/freezerclient/tests/unit/v2/test_client_clients.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from freezerclient import exceptions from freezerclient.v2.managers import clients diff --git a/freezerclient/tests/unit/v2/test_client_jobs.py b/freezerclient/tests/unit/v2/test_client_jobs.py index ab04426780d8771b6298ac98d51973fd3223926e..16f136e9f430259f07fcad16d216b7a514f6cc35 100644 --- a/freezerclient/tests/unit/v2/test_client_jobs.py +++ b/freezerclient/tests/unit/v2/test_client_jobs.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from oslo_serialization import jsonutils as json diff --git a/freezerclient/tests/unit/v2/test_client_sessions.py b/freezerclient/tests/unit/v2/test_client_sessions.py index 6c3df242be943aa1a1bf1010c3af7edd8cf4904b..87c1d84cccbb46c75c808f9cde176824785f9847 100644 --- a/freezerclient/tests/unit/v2/test_client_sessions.py +++ b/freezerclient/tests/unit/v2/test_client_sessions.py @@ -13,8 +13,7 @@ # limitations under the License. import unittest - -import mock +from unittest import mock from oslo_serialization import jsonutils as json diff --git a/freezerclient/utils.py b/freezerclient/utils.py index 4e13b5ed115ccbba7238c2b7110effa89f403130..413b8baf5570d9fa751de463022ad8da8606fbf2 100644 --- a/freezerclient/utils.py +++ b/freezerclient/utils.py @@ -174,10 +174,10 @@ def get_client_class(api_version=None): return importutils.import_class(api_string) -def get_client_instance(kwargs={}, opts=None, api_version=None): +def get_client_instance(opts={}, api_version=None): """Get Freezerclient Instance. We will the provided auth dict to instantiate a client instance Returns freezerclient.v{x}.client.Client Object :return: Object """ - return get_client_class(api_version)(opts=opts, **kwargs) + return get_client_class(api_version)(**opts) diff --git a/freezerclient/v1/client.py b/freezerclient/v1/client.py index 7dff23151386dc04d072411dc694bc6ad4fb5f55..20ad4be675488629bed01da7adf32aca86a0f26d 100644 --- a/freezerclient/v1/client.py +++ b/freezerclient/v1/client.py @@ -31,8 +31,8 @@ class Client(object): """ def __init__(self, token=None, username=None, password=None, - tenant_name=None, auth_url=None, session=None, endpoint=None, - endpoint_type=None, opts=None, project_name=None, + auth_url=None, session=None, endpoint=None, + endpoint_type=None, project_name=None, user_domain_name=None, user_domain_id=None, project_domain_name=None, project_domain_id=None, cert=None, cacert=None, insecure=False, project_id=None): @@ -41,12 +41,10 @@ class Client(object): :param token: keystone token :param username: openstack username :param password: openstack password - :param tenant_name: tenant :param auth_url: keystone-api endpoint :param session: keystone.Session :param endpoint: freezer-api endpoint :param endpoint_type: type of endpoint - :param opts: a namespace to store all keystone data :param project_name: only for version 3 :param user_domain_name: only for version 3 :param user_domain_id: only for version 3 @@ -66,26 +64,22 @@ class Client(object): self.project_id = project_id - if opts is None: - self.opts = utils.Namespace({}) - self.opts.os_token = token or None - self.opts.os_username = username or None - self.opts.os_password = password or None - self.opts.os_tenant_name = tenant_name or None - self.opts.os_auth_url = auth_url or None - self.opts.os_backup_url = endpoint or None - self.opts.os_endpoint_type = endpoint_type or None - self.opts.os_project_name = project_name or None - self.opts.os_project_id = project_id or None - self.opts.os_user_domain_name = user_domain_name or None - self.opts.os_user_domain_id = user_domain_id or None - self.opts.os_project_domain_name = project_domain_name or None - self.opts.os_project_domain_id = project_domain_id or None - self.opts.os_cacert = cacert or None - self.opts.insecure = insecure - self.opts.cert = cert - else: - self.opts = opts + self.opts = utils.Namespace({}) + self.opts.os_token = token or None + self.opts.os_username = username or None + self.opts.os_password = password or None + self.opts.os_auth_url = auth_url or None + self.opts.os_backup_url = endpoint or None + self.opts.os_endpoint_type = endpoint_type or None + self.opts.os_project_name = project_name or None + self.opts.os_project_id = project_id or None + self.opts.os_user_domain_name = user_domain_name or None + self.opts.os_user_domain_id = user_domain_id or None + self.opts.os_project_domain_name = project_domain_name or None + self.opts.os_project_domain_id = project_domain_id or None + self.opts.os_cacert = cacert or None + self.opts.insecure = insecure + self.opts.cert = cert self.cert = cert self.cacert = cacert or self.opts.os_cacert @@ -119,7 +113,6 @@ class Client(object): auth_kwargs.update({ 'username': self.opts.os_username, 'password': self.opts.os_password, - 'tenant_name': self.opts.os_tenant_name, 'user_domain_id': self.opts.os_user_domain_id, 'user_domain_name': self.opts.os_user_domain_name, }) diff --git a/freezerclient/v2/client.py b/freezerclient/v2/client.py index 5783f5cb670dfc8e418f6e4cadd7d384ceed0020..de1650a7ccebcf51d1768b0e924faf6860250d0d 100644 --- a/freezerclient/v2/client.py +++ b/freezerclient/v2/client.py @@ -31,7 +31,7 @@ class Client(object): """ def __init__(self, token=None, username=None, password=None, - tenant_name=None, auth_url=None, session=None, endpoint=None, + auth_url=None, session=None, endpoint=None, endpoint_type=None, opts=None, project_name=None, user_domain_name=None, user_domain_id=None, project_domain_name=None, project_domain_id=None, @@ -41,14 +41,12 @@ class Client(object): :param token: keystone token :param username: openstack username :param password: openstack password - :param tenant_name: tenant :param auth_url: keystone-api endpoint :param session: keystone.Session :param endpoint: freezer-api endpoint :param endpoint_type: type of endpoint :param opts: a namespace to store all keystone data :param project_name: only for version 3 - :param tenant_id: only for version 2 :param user_domain_name: only for version 3 :param user_domain_id: only for version 3 :param project_domain_name: only for version 3 @@ -71,7 +69,6 @@ class Client(object): self.opts.os_token = token or None self.opts.os_username = username or None self.opts.os_password = password or None - self.opts.os_tenant_name = tenant_name or None self.opts.os_auth_url = auth_url or None self.opts.os_backup_url = endpoint or None self.opts.os_endpoint_type = endpoint_type or None @@ -119,7 +116,6 @@ class Client(object): auth_kwargs.update({ 'username': self.opts.os_username, 'password': self.opts.os_password, - 'tenant_name': self.opts.os_tenant_name, 'user_domain_id': self.opts.os_user_domain_id, 'user_domain_name': self.opts.os_user_domain_name, }) diff --git a/lower-constraints.txt b/lower-constraints.txt index b5424ad20c4758340c9e63234d714e43bf65f7a1..5f9719fcd5b8310e6be6042a6d36488cc2b744df 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -1,51 +1,40 @@ alabaster==0.7.10 -astroid==1.6.5 +astroid==2.1.0 Babel==2.3.4 cliff==2.8.0 cmd2==0.8.0 -coverage==4.0 +coverage==4.5.1 debtcollector==1.2.0 docutils==0.11 dulwich==0.15.0 extras==1.0.0 fixtures==3.0.0 -flake8==2.5.5 -hacking==0.12.0 imagesize==0.7.1 iso8601==0.1.11 Jinja2==2.10 keystoneauth1==3.4.0 linecache2==1.0.0 logilab-common==1.4.1 -MarkupSafe==1.0 -mccabe==0.4.0 -mock==2.0.0 +MarkupSafe==1.1.1 monotonic==0.6 netaddr==0.7.18 netifaces==0.10.4 -openstackdocstheme==1.20.0 oslo.i18n==3.15.3 oslo.serialization==2.25.0 oslo.utils==3.33.0 pbr==2.0.0 -pep8==1.7.1 prettytable==0.7.2 -pyflakes==1.0.0 Pygments==2.2.0 -pylint==1.9.2 +pylint==2.2.0 pyparsing==2.1.0 pyperclip==1.5.27 python-mimeparse==1.6.0 python-subunit==1.0.0 pytz==2013.6 -PyYAML==3.12 -reno==2.5.0 +PyYAML==3.13 requests==2.14.2 setuptools==21.0.0 -six==1.10.0 snowballstemmer==1.2.1 -Sphinx==1.6.5 -sphinxcontrib-websupport==1.0.1 stevedore==1.20.0 stestr==2.0.0 testtools==2.2.0 diff --git a/releasenotes/notes/drop-py-2-7-9a3fc069f66d62bc.yaml b/releasenotes/notes/drop-py-2-7-9a3fc069f66d62bc.yaml new file mode 100644 index 0000000000000000000000000000000000000000..7fe69ff8475fabe8fec3dbf57d6f9f65a8a7a0a3 --- /dev/null +++ b/releasenotes/notes/drop-py-2-7-9a3fc069f66d62bc.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + Python 2.7 support has been dropped. Last release of python-freezerclient + to support python 2.7 is OpenStack Train. The minimum version of Python now + supported is Python 3.6. diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py index 0566a563d63149889355466adb74f3b6b6262593..81d35f3925cd082f9b30df3d9a0050b2179d0d9d 100644 --- a/releasenotes/source/conf.py +++ b/releasenotes/source/conf.py @@ -44,9 +44,9 @@ master_doc = 'index' # General information about the project. copyright = u'2016, Freezer developers' -repository_name = 'openstack/python-freezerclient' -bug_project = 'freezer' -bug_tag = 'python-freezerclient' +openstackdocs_repo_name = 'openstack/python-freezerclient' +openstackdocs_bug_project = 'freezer' +openstackdocs_bug_tag = 'python-freezerclient' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -78,7 +78,7 @@ exclude_patterns = [] #show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = 'native' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst index 263ed21e8dcd5aae06437004c54512aa73aa6c5d..f7f5972f1616f23e0d29e06583f7f0a7b5c5b6e5 100644 --- a/releasenotes/source/index.rst +++ b/releasenotes/source/index.rst @@ -8,6 +8,7 @@ Contents :maxdepth: 2 unreleased + ussuri stein queens pike diff --git a/releasenotes/source/ussuri.rst b/releasenotes/source/ussuri.rst new file mode 100644 index 0000000000000000000000000000000000000000..e21e50e0c616efa6319759a8533eb042b20e7bca --- /dev/null +++ b/releasenotes/source/ussuri.rst @@ -0,0 +1,6 @@ +=========================== +Ussuri Series Release Notes +=========================== + +.. release-notes:: + :branch: stable/ussuri diff --git a/setup.cfg b/setup.cfg index 8ad7e8469c83212dcd1016575b10600366e89061..146c28a21a00c3d03772c59b7ee6ecf714212b91 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,13 +7,14 @@ license = Apache License, Version 2.0 author = OpenStack author-email = openstack-discuss@lists.openstack.org home-page = https://docs.openstack.org/python-freezerclient/latest/ +python-requires = >=3.6 classifier = Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 Development Status :: 5 - Production/Stable Natural Language :: English Environment :: OpenStack diff --git a/setup.py b/setup.py index 566d84432eeda2c367f881c596d327a703beb79a..cd35c3c35bf1561bb136217711b0c9c163f4c796 100644 --- a/setup.py +++ b/setup.py @@ -13,17 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT import setuptools -# In python < 2.7.4, a lazy loading of package `pbr` will break -# setuptools if some other modules registered functions in `atexit`. -# solution from: http://bugs.python.org/issue15881#msg170215 -try: - import multiprocessing # noqa -except ImportError: - pass - setuptools.setup( setup_requires=['pbr>=2.0.0'], pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt index ccec41c3f802699f2c34a37e9a9dbc017e5f5916..0c6130bf41bc4dfc357daf5a8d99f888d8e70165 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,14 +1,13 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -flake8<2.6.0,>=2.5.4 # MIT -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 -coverage!=4.4,>=4.0 # Apache-2.0 -mock>=2.0.0 # BSD -#pylint==1.9.2 # GPLv2 + +# Hacking pins already flake8 etc version +hacking>=3.0.1,<3.1.0 # Apache-2.0 + +coverage>=4.5.1 # Apache-2.0 stestr>=2.0.0 # Apache-2.0 testtools>=2.2.0 # MIT -astroid==1.6.5;python_version<"3.0" # LGPLv2.1 -astroid==2.1.0;python_version>="3.0" # LGPLv2.1 -pylint==1.9.2;python_version<"3.0" # GPLv2 -pylint==2.2.0;python_version>="3.0" # GPLv2 +astroid==2.1.0 # LGPLv2.1 +isort==4.3.21 #MIT +pylint==2.2.0 # GPLv2 diff --git a/tox.ini b/tox.ini index cb1e90e7ed44610d4ceb47bd1492bfe3b4aecdf9..a42d5c790620899363b838210fe4c9dfeb31420c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,11 @@ [tox] -minversion = 2.0 -envlist = py27,py36,py37,pep8,pylint,docs +minversion = 3.1.1 +envlist = py3,pep8,pylint,docs skipsdist = True +ignore_basepython_conflict = True [testenv] +basepython = python3 usedevelop = True deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} @@ -34,29 +36,22 @@ python_files = test_*.py norecursedirs = .tox .venv [testenv:venv] -basepython = python3 commands = {posargs} -[testenv:py27] -basepython = python2.7 - [testenv:py36] basepython = python3.6 -[testenv:py37] -basepython = python3.7 +[testenv:py38] +basepython = python3.8 [testenv:docs] -basepython = python3 deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -b html doc/source doc/build/html [testenv:pep8] -basepython = python3 commands = flake8 freezerclient [testenv:pylint] -basepython = python3 commands = pylint --rcfile .pylintrc freezerclient [flake8] @@ -74,7 +69,6 @@ exclude = .venv,.tox,dist,doc,*egg,releasenotes [testenv:releasenotes] -basepython = python3 deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt @@ -82,7 +76,6 @@ deps = commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:lower-constraints] -basepython = python3 deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt