Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37c6bb0c8b | ||
|
|
1e0ed2f044 | ||
|
|
c1596862ae | ||
|
|
56c5badada | ||
| 97e2a29496 | |||
| ce7aef7912 |
@@ -1,5 +1,5 @@
|
||||
[gerrit]
|
||||
host=review.openstack.org
|
||||
host=review.opendev.org
|
||||
port=29418
|
||||
project=openstack/python-cloudkittyclient.git
|
||||
defaultbranch=stable/stein
|
||||
defaultbranch=stable/rocky
|
||||
|
||||
27
.zuul.yaml
27
.zuul.yaml
@@ -18,44 +18,27 @@
|
||||
- ^releasenotes/.*$
|
||||
vars:
|
||||
devstack_plugins:
|
||||
cloudkitty: https://git.openstack.org/openstack/cloudkitty
|
||||
devstack_localrc:
|
||||
CLOUDKITTY_FETCHER: keystone
|
||||
cloudkitty: https://opendev.org/openstack/cloudkitty
|
||||
devstack_services:
|
||||
ck-api: true
|
||||
horizon: false
|
||||
tox_install_siblings: false
|
||||
zuul_work_dir: src/git.openstack.org/openstack/python-cloudkittyclient
|
||||
zuul_work_dir: src/opendev.org/openstack/python-cloudkittyclient
|
||||
tox_envlist: functional
|
||||
|
||||
- job:
|
||||
name: cloudkittyclient-devstack-functional-py3
|
||||
parent: cloudkittyclient-devstack-functional
|
||||
description: |
|
||||
Job for cloudkittyclient functional tests, ran in python3.
|
||||
vars:
|
||||
devstack_localrc:
|
||||
DEVSTACK_GATE_USE_PYTHON3: "True"
|
||||
USE_PYTHON3: "True"
|
||||
|
||||
- project:
|
||||
templates:
|
||||
- check-requirements
|
||||
- openstack-cover-jobs
|
||||
- openstack-python-jobs
|
||||
- openstack-python35-jobs
|
||||
- openstack-python36-jobs
|
||||
- openstackclient-plugin-jobs
|
||||
- publish-openstack-docs-pti
|
||||
check:
|
||||
jobs:
|
||||
- cloudkittyclient-devstack-functional:
|
||||
voting: true
|
||||
- cloudkittyclient-devstack-functional-py3:
|
||||
voting: true
|
||||
gate:
|
||||
jobs:
|
||||
- cloudkittyclient-devstack-functional:
|
||||
voting: true
|
||||
- cloudkittyclient-devstack-functional-py3:
|
||||
voting: true
|
||||
post:
|
||||
jobs:
|
||||
- openstack-tox-cover
|
||||
|
||||
@@ -30,12 +30,7 @@ def make_client(instance):
|
||||
version,
|
||||
API_VERSIONS)
|
||||
instance.setup_auth()
|
||||
adapter_options = dict(
|
||||
interface=instance.interface,
|
||||
region_name=instance.region_name,
|
||||
)
|
||||
return ck_client(session=instance.session,
|
||||
adapter_options=adapter_options)
|
||||
return ck_client(session=instance.session)
|
||||
|
||||
|
||||
def build_option_parser(parser):
|
||||
|
||||
@@ -35,7 +35,7 @@ class BaseFunctionalTest(utils.BaseTestCase):
|
||||
if p.returncode != 0:
|
||||
raise RuntimeError('"{cmd}" returned {val}: {msg}'.format(
|
||||
cmd=' '.join(cmd), val=p.returncode, msg=stderr))
|
||||
return json.loads(stdout) if has_output else None
|
||||
return json.loads(stdout.decode('ascii')) if has_output else None
|
||||
|
||||
def openstack(self, action,
|
||||
flags='', params='', fmt='-f json', has_output=True):
|
||||
|
||||
@@ -22,8 +22,8 @@ class CkReportTest(base.BaseFunctionalTest):
|
||||
self.runner = self.cloudkitty
|
||||
|
||||
def test_get_summary(self):
|
||||
resp = self.runner('summary get')
|
||||
self.assertEqual(len(resp), 0)
|
||||
resp = self.runner('summary get')[0]
|
||||
self.assertEqual(resp['Resource Type'], 'ALL')
|
||||
|
||||
def test_get_summary_with_groupby(self):
|
||||
resp = self.runner('summary get', params='-g res_type tenant_id')
|
||||
|
||||
@@ -25,26 +25,12 @@ from cloudkittyclient.v1 import storage
|
||||
|
||||
class Client(object):
|
||||
|
||||
def __init__(self,
|
||||
session=None,
|
||||
adapter_options={},
|
||||
cacert=None,
|
||||
insecure=False,
|
||||
**kwargs):
|
||||
def __init__(self, session=None, adapter_options={}, **kwargs):
|
||||
adapter_options.setdefault('service_type', 'rating')
|
||||
|
||||
if insecure:
|
||||
verify_cert = False
|
||||
else:
|
||||
if cacert:
|
||||
verify_cert = cacert
|
||||
else:
|
||||
verify_cert = True
|
||||
|
||||
self.session = session
|
||||
if self.session is None:
|
||||
self.session = ks_session.Session(
|
||||
verify=verify_cert, **kwargs)
|
||||
self.session = ks_session.Session(**kwargs)
|
||||
|
||||
self.api_client = adapter.Adapter(
|
||||
session=self.session, **adapter_options)
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
openstackdocstheme>=1.18.1 # Apache-2.0
|
||||
sphinx>=1.6.2,!=1.6.6,!=1.6.7 # BSD
|
||||
reno>=2.5.0 # Apache-2.0
|
||||
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
|
||||
reno>=2.5.0 # Apache2
|
||||
|
||||
@@ -49,16 +49,6 @@ Else, use it the same way as any other OpenStack client::
|
||||
u'res_type': u'ALL',
|
||||
u'tenant_id': u'bea6a24f77e946b0a92dca7c78b7870b'}]}
|
||||
|
||||
.. warning::
|
||||
|
||||
If you want to use SSL with the client as a python library, you need to
|
||||
provide a cert to keystone's session object. Else, two additional options
|
||||
are available if you provide an ``auth`` object to the client: ``insecure``
|
||||
and ``cacert``::
|
||||
|
||||
>>> client = ck_client.Client(
|
||||
'1', auth=auth, insecure=False, cacert='/path/to/ca')
|
||||
|
||||
When using the ``cloudkitty`` CLI client with keystone authentication, the
|
||||
auth plugin to use should automagically be detected. If not, you can specify
|
||||
the auth plugin to use with ``--os-auth-type/--os-auth-plugin``::
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# requirements
|
||||
pbr==2.0.0 # Apache-2.0
|
||||
cliff==2.11.0 # Apache-2.0
|
||||
keystoneauth1==3.4.0 # Apache-2.0
|
||||
oslo.utils==3.35 # Apache-2.0
|
||||
oslo.log==3.36 # Apache-2.0
|
||||
PyYAML==3.12 # MIT
|
||||
jsonpath-rw-ext==1.0 # Apache-2.0
|
||||
six==1.11 # MIT
|
||||
os-client-config==1.29.0 # Apache-2.0
|
||||
|
||||
# test-requirements.txt
|
||||
coverage==4.0 # Apache-2.0
|
||||
python-subunit==0.0.18 # Apache-2.0/BSD
|
||||
oslotest==1.10.0 # Apache-2.0
|
||||
stestr==2.0 # Apache-2.0
|
||||
mock==2.0 # BSD
|
||||
python-openstackclient==3.14 # Apache-2.0
|
||||
|
||||
# doc/requirements.txt
|
||||
openstackdocstheme==1.18.1 # Apache-2.0
|
||||
sphinx==1.6.2 # BSD
|
||||
reno==2.5.0 # Apache2
|
||||
@@ -16,6 +16,7 @@
|
||||
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||
#sys.path.insert(0, os.path.abspath('.'))
|
||||
|
||||
import pbr.version
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
# If your documentation needs a minimal Sphinx version, state it here.
|
||||
@@ -25,8 +26,8 @@
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'oslosphinx',
|
||||
'reno.sphinxext',
|
||||
'openstackdocstheme',
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
@@ -45,12 +46,16 @@ master_doc = 'index'
|
||||
project = u'Cloudkitty Client Release Notes'
|
||||
copyright = u'2016, Cloudkitty developers'
|
||||
|
||||
# Release notes are version independent.
|
||||
# The short X.Y version.
|
||||
version = ''
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = ''
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
|
||||
cloudkittyclient_version = pbr.version.VersionInfo('python-cloudkittyclient')
|
||||
# The short X.Y version.
|
||||
version = cloudkittyclient_version.canonical_version_string()
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = cloudkittyclient_version.version_string_with_vcs()
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
@@ -95,7 +100,7 @@ pygments_style = 'sphinx'
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
html_theme = 'openstackdocs'
|
||||
html_theme = 'default'
|
||||
|
||||
# Theme options are theme-specific and customize the look and feel of a theme
|
||||
# further. For a list of options available for each theme, see the
|
||||
|
||||
@@ -8,7 +8,6 @@ Contents
|
||||
:maxdepth: 2
|
||||
|
||||
unreleased
|
||||
rocky
|
||||
queens
|
||||
|
||||
Indices and tables
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
===================================
|
||||
Rocky Series Release Notes
|
||||
===================================
|
||||
|
||||
.. release-notes::
|
||||
:branch: stable/rocky
|
||||
@@ -2,12 +2,12 @@
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
|
||||
pbr>=2.0.0,!=2.1.0 # Apache-2.0
|
||||
cliff>=2.11.0 # Apache-2.0
|
||||
keystoneauth1>=3.4.0 # Apache-2.0
|
||||
oslo.utils>=3.35 # Apache-2.0
|
||||
oslo.log>=3.36 # Apache-2.0
|
||||
PyYAML>=3.12 # MIT
|
||||
pbr!=2.1.0,>=2.0.0 # Apache-2.0
|
||||
cliff>=2.11.0,<3.0 # Apache-2.0
|
||||
keystoneauth1>=3.4.0,<4.0 # Apache-2.0
|
||||
oslo.utils>=3.35,<4.0 # Apache-2.0
|
||||
oslo.log>=3.36,<4.0 # Apache-2.0
|
||||
PyYAML>=3.12,<4.0 # MIT
|
||||
jsonpath-rw-ext>=1.0 # Apache-2.0
|
||||
six>=1.11 # MIT
|
||||
six>=1.11,<2.0 # MIT
|
||||
os-client-config>=1.29.0 # Apache-2.0
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
|
||||
|
||||
coverage>=4.0,!=4.4 # Apache-2.0
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
python-subunit>=0.0.18 # Apache-2.0/BSD
|
||||
oslotest>=1.10.0 # Apache-2.0
|
||||
stestr>=2.0 # Apache-2.0
|
||||
|
||||
16
tox.ini
16
tox.ini
@@ -1,29 +1,17 @@
|
||||
[tox]
|
||||
minversion = 2.0
|
||||
minversion = 1.6
|
||||
envlist = py35,py27,pypy,pep8
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/stein} -U {opts} {packages}
|
||||
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky} -U {opts} {packages}
|
||||
setenv =
|
||||
VIRTUAL_ENV={envdir}
|
||||
deps = -r{toxinidir}/requirements.txt
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
commands = stestr run {posargs}
|
||||
|
||||
[testenv:cover]
|
||||
basepython = python3
|
||||
setenv =
|
||||
VIRTUAL_ENV={envdir}
|
||||
PYTHON=coverage run --source cloudkittyclient --parallel-mode
|
||||
commands =
|
||||
stestr run {posargs}
|
||||
coverage combine
|
||||
coverage html -d cover
|
||||
coverage xml -o cover/coverage.xml
|
||||
coverage report
|
||||
|
||||
[testenv:debug]
|
||||
basepython = python3
|
||||
commands = oslo_debug_helper {posargs}
|
||||
|
||||
Reference in New Issue
Block a user