Compare commits

..

23 Commits

Author SHA1 Message Date
c5f5380c8f Update TOX_CONSTRAINTS_FILE for stable/2024.2
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.

Until the requirements repository has as stable/2024.2 branch, tests will
continue to use the upper-constraints list on master.

Change-Id: Icfd9ec1a90af83e190ce501c374f745cfdb94b52
2024-09-05 15:54:50 +00:00
63e17af59c Update .gitreview for stable/2024.2
Change-Id: I87fbc35aacaaf726a71f3e5e198996521c668436
2024-09-05 15:54:49 +00:00
Zuul
79a4606ce2 Merge "add group by time help to CLI" 2024-06-26 12:16:31 +00:00
Zuul
e912feb85d Merge "Fix reprocessing POST request" 2024-04-29 11:41:36 +00:00
Zuul
9bb62e0338 Merge "reno: Update master for unmaintained/victoria" 2024-04-29 10:59:58 +00:00
8d992f59dd reno: Update master for unmaintained/zed
Update the zed release notes configuration to build from
unmaintained/zed.

Change-Id: I89f8f9f24499c2aaf663f3463143a688102e78e1
2024-04-26 18:15:28 +00:00
Matt Crees
6ee36ef0e3 Fix reprocessing POST request
The POST request for triggering reprocessing needs to be made to
``/v2/task/reprocesses``. This is the same as for other requests, so we
can drop ``url_for_post``.

Change-Id: If630d4f313c875733dbe1937ff7ca625821e04af
2024-04-23 17:01:09 +01:00
Rafael Weingärtner
98c13304bd add group by time help to CLI
Change-Id: I2176ab207f94b6f986ebc32371f85c47b097a116
2024-04-11 09:41:40 -03:00
Zuul
024399e10a Merge "reno: Update master for unmaintained/xena" 2024-03-30 11:45:09 +00:00
Zuul
0698fdde3a Merge "reno: Update master for unmaintained/wallaby" 2024-03-30 11:41:09 +00:00
bb26dbc381 Update master for stable/2024.1
Add file to the reno documentation build to show release notes for
stable/2024.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2024.1.

Sem-Ver: feature
Change-Id: I4bc29c5959626c2a2f55f943f6c25bb32a9dad99
2024-03-07 15:35:53 +00:00
d876b1b77f reno: Update master for unmaintained/xena
Update the xena release notes configuration to build from
unmaintained/xena.

Change-Id: Ia90b7810a48e5ecce59dcd9d86c556c2574016ad
2024-03-05 14:55:15 +00:00
2a3733e869 reno: Update master for unmaintained/wallaby
Update the wallaby release notes configuration to build from
unmaintained/wallaby.

Change-Id: If27a329a11330fa569d272224753a953c836f81f
2024-03-05 14:54:50 +00:00
00043cc23f reno: Update master for unmaintained/victoria
Update the victoria release notes configuration to build from
unmaintained/victoria.

Change-Id: I7c621c3eaca3ef115e6bbf13aef0044bbd1924b7
2024-03-05 14:54:26 +00:00
Zuul
d30991cefa Merge "reno: Update master for unmaintained/yoga" 2024-02-13 11:26:37 +00:00
36566c32fc reno: Update master for unmaintained/yoga
Update the yoga release notes configuration to build from
unmaintained/yoga.

Change-Id: I00904420fe9ef2cae1ea0d507e40f99b95bcae9e
2024-02-05 16:43:11 +00:00
Ghanshyam Mann
3e9fd5b540 Update python classifier in setup.cfg
As per the current release tested runtime, we test
till python 3.11 so updating the same in python
classifier in setup.cfg

Change-Id: I8695f7f097e4dd98850caab63ea914f0dbf5da11
2024-01-03 21:22:36 -08:00
255a871785 Update master for stable/2023.2
Add file to the reno documentation build to show release notes for
stable/2023.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.2.

Sem-Ver: feature
Change-Id: Iae9e9a83c2dcf5edf16d86ce1ec802c6310caa1a
2023-09-07 09:35:33 +00:00
Rafael Weingärtner
244f229af7 Fix passenv declaration in tox.ini and function tests python env
While running the tests with the latest tox I was getting the following error message:
```
failed with pass_env values cannot contain whitespace, use comma to have multiple values in a single line'

```

That error is happening because of the passenv declaration. This patch is proposing a fix for that.

Besides the `tox` issue, we also needed to create a patch for the use of virtual env inside DevStack.
This patches presents a solution to run tests using the virtual env of DevStack.

Change-Id: Id8249ebb15d4047dcc6181908eae66eb39722863
2023-08-31 20:18:31 -03:00
0835706738 Update master for stable/2023.1
Add file to the reno documentation build to show release notes for
stable/2023.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.1.

Sem-Ver: feature
Change-Id: I382ddca39bceac78b1fed648738edfaa5655117e
2023-02-21 14:50:01 +00:00
97dc4d64da Switch to 2023.1 Python3 unit tests and generic template name
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for antelope. Also,
updating the template name to generic one.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: Ibd133ec5cb0af7c0835a9014cc44b201050bd15c
2022-09-14 09:15:01 +00:00
0c97e40e2b Update master for stable/zed
Add file to the reno documentation build to show release notes for
stable/zed.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.

Sem-Ver: feature
Change-Id: Iac2443a8053991e604fdab64bced60a7030d9772
2022-09-09 11:44:57 +00:00
niuke
0ee5e17ee5 remove unicode prefix from code
Change-Id: I716442a44cdb0cd651cfed8419713c6d76f2ba14
2022-08-24 19:47:52 +08:00
20 changed files with 137 additions and 35 deletions

1
.gitignore vendored
View File

@@ -16,3 +16,4 @@ dist
AUTHORS
ChangeLog
releasenotes/build
.idea/

View File

@@ -2,4 +2,4 @@
host=review.opendev.org
port=29418
project=openstack/python-cloudkittyclient.git
defaultbranch=stable/zed
defaultbranch=stable/2024.2

View File

@@ -45,7 +45,7 @@
templates:
- check-requirements
- openstack-cover-jobs
- openstack-python3-zed-jobs
- openstack-python3-jobs
- openstackclient-plugin-jobs
- publish-openstack-docs-pti
- release-notes-jobs-python3

View File

@@ -15,26 +15,57 @@
#
import json
import os
import shlex
import subprocess
from cloudkittyclient.tests import utils
from oslo_log import log
LOG = log.getLogger(__name__)
class BaseFunctionalTest(utils.BaseTestCase):
# DevStack is using VENV by default. Therefore, to execute the commands,
# we need to activate the VENV. And, to do that, we need the VENV path.
# This path is hardcoded here because we could not find a variable in this
# Python code to retrieve the VENV variable from the test machine.
# It seems that because of the stack TOX -> stestr -> this python code, and
# so on, we are not able to access the DevStack variables here.
#
# If somebody finds a solution, we can remove the hardcoded path here.
DEV_STACK_VENV_BASE_PATH = "/opt/stack/data/venv"
BASE_COMMAND_WITH_VENV = "source %s/bin/activate && %s "
def _run(self, executable, action,
flags='', params='', fmt='-f json', stdin=None, has_output=True):
if not has_output:
fmt = ''
does_venv_exist = not os.system("ls -lah /opt/stack/data/venv")
LOG.info("Test to check if the VENV file exist returned: [%s].",
does_venv_exist)
system_variables = os.environ.copy()
LOG.info("System variables [%s] found when executing the tests.",
system_variables)
cmd = ' '.join([executable, flags, action, params, fmt])
cmd = shlex.split(cmd)
actual_command_with_venv = self.BASE_COMMAND_WITH_VENV % (
self.DEV_STACK_VENV_BASE_PATH, cmd)
LOG.info("Command being executed: [%s].", actual_command_with_venv)
p = subprocess.Popen(
cmd, env=os.environ.copy(), shell=False,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
stdin=subprocess.PIPE if stdin else None,
["bash", "-c", actual_command_with_venv],
env=os.environ.copy(), shell=False, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stdin=subprocess.PIPE if stdin else None
)
stdout, stderr = p.communicate(input=stdin)
LOG.info("Standard output [%s] and error output [%s] for command "
"[%s]. ", stdout, stderr, actual_command_with_venv)
if p.returncode != 0:
raise RuntimeError('"{cmd}" returned {val}: {msg}'.format(
cmd=' '.join(cmd), val=p.returncode, msg=stderr))

View File

@@ -19,8 +19,6 @@ class ReprocessingManager(base.BaseManager):
url = '/v2/task/reprocesses'
url_to_post = '/v2/task/reprocess'
def get_reprocessing_tasks(self, offset=0, limit=100, scope_ids=[],
order="DESC", **kwargs):
"""Returns a paginated list of reprocessing tasks.
@@ -75,4 +73,4 @@ class ReprocessingManager(base.BaseManager):
body = dict(filter(lambda elem: bool(elem[1]), body.items()))
return self.api_client.post(self.url_to_post, json=body).json()
return self.api_client.post(self.url, json=body).json()

View File

@@ -35,10 +35,20 @@ class CliSummaryGet(lister.Lister):
help='Maximal number of elements')
parser.add_argument('-g', '--groupby', type=str, action='append',
help='Attribute to group the summary by. Can be '
'specified several times')
'specified several times. One can also group '
'by different time options such as: "time-d" '
'to group by day of the year, "time-w" to '
'group by week of the year, "time-m" to '
'group by month, and "time-y" to group data '
'by year.')
parser.add_argument('--filter', type=filter_, action='append',
help="Optional filter, in 'key:value' format. Can "
"be specified several times.")
"be specified several times. It is also "
"possible to filter data using the group by "
"values. However, one needs to group by as "
"well; for instance, if one wants to filter "
"by resource id (id), then we need to group "
"by id via the option '-g id'.")
parser.add_argument('-b', '--begin', type=timeutils.parse_isotime,
help="Start of the period to query, in iso8601 "
"format. Example: 2019-05-01T00:00:00Z.")

View File

@@ -44,8 +44,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'python-cloudkittyclient'
copyright = u'2017, OpenStack Foundation'
project = 'python-cloudkittyclient'
copyright = '2017, OpenStack Foundation'
# openstackdocstheme options
repository_name = 'openstack/python-cloudkittyclient'
@@ -99,8 +99,8 @@ latex_elements = {
latex_documents = [
('index',
'doc-%s.tex' % project,
u'%s Documentation' % project,
u'OpenStack Foundation', 'howto', True),
'%s Documentation' % project,
'OpenStack Foundation', 'howto', True),
]
# Example configuration for intersphinx: refer to the Python standard library.

View File

@@ -0,0 +1,5 @@
---
fixes:
- |
Fixed a bug where creating a reprocessing task would fail due to sending a
POST request to the wrong endpoint.

View File

@@ -0,0 +1,6 @@
===========================
2023.1 Series Release Notes
===========================
.. release-notes::
:branch: stable/2023.1

View File

@@ -0,0 +1,6 @@
===========================
2023.2 Series Release Notes
===========================
.. release-notes::
:branch: stable/2023.2

View File

@@ -0,0 +1,6 @@
===========================
2024.1 Series Release Notes
===========================
.. release-notes::
:branch: stable/2024.1

View File

@@ -42,8 +42,8 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'CloudKitty Client Release Notes'
copyright = u'2016, CloudKitty developers'
project = 'CloudKitty Client Release Notes'
copyright = '2016, CloudKitty developers'
# Release notes are version independent.
# The short X.Y version.
@@ -194,8 +194,8 @@ latex_elements = {
# author, documentclass [howto, manual, or own class]).
latex_documents = [
('index', 'PythonCloudKittyClient.tex',
u'CloudKitty Client Release Notes Documentation',
u'CloudKitty developers', 'manual'),
'CloudKitty Client Release Notes Documentation',
'CloudKitty developers', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -225,8 +225,8 @@ latex_documents = [
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'cloudkittyclient',
u'CloudKitty Client Release Notes Documentation',
[u'CloudKitty developers'], 1)
'CloudKitty Client Release Notes Documentation',
['CloudKitty developers'], 1)
]
# If true, show URL addresses after external links.
@@ -240,8 +240,8 @@ man_pages = [
# dir menu entry, description, category)
texinfo_documents = [
('index', 'cloudkittyclient',
u'CloudKitty Client Release Notes Documentation',
u'CloudKitty Client developers', 'CloudKittyClient',
'CloudKitty Client Release Notes Documentation',
'CloudKitty Client developers', 'CloudKittyClient',
'One line description of project.', 'Miscellaneous'),
]

View File

@@ -8,6 +8,10 @@ Contents
:maxdepth: 2
unreleased
2024.1
2023.2
2023.1
zed
yoga
xena
wallaby

View File

@@ -3,4 +3,4 @@ Victoria Series Release Notes
=============================
.. release-notes::
:branch: stable/victoria
:branch: unmaintained/victoria

View File

@@ -3,4 +3,4 @@ Wallaby Series Release Notes
============================
.. release-notes::
:branch: stable/wallaby
:branch: unmaintained/wallaby

View File

@@ -3,4 +3,4 @@ Xena Series Release Notes
=========================
.. release-notes::
:branch: stable/xena
:branch: unmaintained/xena

View File

@@ -3,4 +3,4 @@ Yoga Series Release Notes
=========================
.. release-notes::
:branch: stable/yoga
:branch: unmaintained/yoga

View File

@@ -0,0 +1,6 @@
========================
Zed Series Release Notes
========================
.. release-notes::
:branch: unmaintained/zed

View File

@@ -6,7 +6,7 @@ description_file =
author = OpenStack
author_email = openstack-discuss@lists.openstack.org
home_page = https://docs.openstack.org/python-cloudkittyclient/latest/
python_requires = >=3.6
python_requires = >=3.8
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
@@ -17,10 +17,10 @@ classifier =
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
[files]
packages =

37
tox.ini
View File

@@ -9,6 +9,7 @@ basepython = python3
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
DEVSTACK_VENV={env:DEVSTACK_VENV}
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
@@ -29,12 +30,40 @@ commands =
commands = oslo_debug_helper -t cloudkittyclient/tests {posargs}
[testenv:functional-v1]
passenv = OS_CLOUD OS_PROJECT_DOMAIN_ID OS_USER_DOMAIN_ID OS_PROJECT_DOMAIN_NAME OS_USER_DOMAIN_NAME OS_PROJECT_NAME OS_IDENTITY_API_VERSION OS_PASSWORD OS_AUTH_TYPE OS_AUTH_URL OS_USERNAME OS_ENDPOINT
passenv =
OS_CLOUD
OS_PROJECT_DOMAIN_ID
OS_USER_DOMAIN_ID
OS_PROJECT_DOMAIN_NAME
OS_USER_DOMAIN_NAME
OS_PROJECT_NAME
OS_IDENTITY_API_VERSION
OS_PASSWORD
OS_AUTH_TYPE
OS_AUTH_URL
OS_USERNAME
OS_ENDPOINT
DEVSTACK_VENV
VIRTUAL_ENV
setenv = OS_RATING_API_VERSION=1
commands = stestr run --concurrency=1 --test-path ./cloudkittyclient/tests/functional/v1
[testenv:functional-v2]
passenv = OS_CLOUD OS_PROJECT_DOMAIN_ID OS_USER_DOMAIN_ID OS_PROJECT_DOMAIN_NAME OS_USER_DOMAIN_NAME OS_PROJECT_NAME OS_IDENTITY_API_VERSION OS_PASSWORD OS_AUTH_TYPE OS_AUTH_URL OS_USERNAME OS_ENDPOINT
passenv =
OS_CLOUD
OS_PROJECT_DOMAIN_ID
OS_USER_DOMAIN_ID
OS_PROJECT_DOMAIN_NAME
OS_USER_DOMAIN_NAME
OS_PROJECT_NAME
OS_IDENTITY_API_VERSION
OS_PASSWORD
OS_AUTH_TYPE
OS_AUTH_URL
OS_USERNAME
OS_ENDPOINT
DEVSTACK_VENV
VIRTUAL_ENV
setenv = OS_RATING_API_VERSION=2
commands = stestr run --concurrency=1 --test-path ./cloudkittyclient/tests/functional/v2
@@ -46,7 +75,7 @@ commands = {posargs}
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/zed}
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.2}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build --keep-going -b html doc/source doc/build/html
@@ -72,7 +101,7 @@ import_exceptions = cloudkittyclient.i18n
[testenv:releasenotes]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/zed}
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.2}
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html