././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3323593 ceilometermiddleware-3.13.0/0000775000175000017500000000000015242063023014603 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3660896 ceilometermiddleware-3.13.0/.coveragerc0000664000175000017500000000016515242062750016734 0ustar00zuulzuul[run] branch = True source = ceilometermiddleware omit = ceilometermiddleware/tests/* [report] ignore_errors = True ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3670895 ceilometermiddleware-3.13.0/.pre-commit-config.yaml0000664000175000017500000000172615242062750021100 0ustar00zuulzuulrepos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: - id: trailing-whitespace # Replaces or checks mixed line ending - id: mixed-line-ending args: ['--fix', 'lf'] exclude: '.*\.(svg)$' # Forbid files which have a UTF-8 byte-order marker - id: fix-byte-order-marker # Checks that non-binary executables have a proper shebang - id: check-executables-have-shebangs # Check for files that contain merge conflict strings. - id: check-merge-conflict # Check for debugger imports and py37+ breakpoint() # calls in python source - id: debug-statements - id: check-yaml files: .*\.(yaml|yml)$ - repo: https://opendev.org/openstack/hacking rev: 8.0.0 hooks: - id: hacking additional_dependencies: [] - repo: https://github.com/asottile/pyupgrade rev: v3.21.2 hooks: - id: pyupgrade args: [--py311-plus] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3670895 ceilometermiddleware-3.13.0/.stestr.conf0000664000175000017500000000007515242062750017064 0ustar00zuulzuul[DEFAULT] test_path=./ceilometermiddleware/tests top_dir=./ ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3670895 ceilometermiddleware-3.13.0/.zuul.yaml0000664000175000017500000000126515242062750016556 0ustar00zuulzuul- job: name: ceilometermiddleware-integration parent: telemetry-dsvm-integration required-projects: - openstack/ceilometermiddleware irrelevant-files: - ^\.gitignore$ - ^\.gitreview$ - ^\.pre-commit-config\.yaml$ - ^test-requirements\.txt$ - ^setup.cfg$ - ^doc/.*$ - ^.*\.rst$ - ^releasenotes/.*$ - ^ceilometermiddleware/tests/.*$ - project: templates: - openstack-python3-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 - check-requirements check: jobs: - ceilometermiddleware-integration gate: jobs: - ceilometermiddleware-integration ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.1733592 ceilometermiddleware-3.13.0/AUTHORS0000664000175000017500000000377015242063023015662 0ustar00zuulzuulAndreas Jaeger Andrew Smith Cao Xuan Hoang Chris Dent Clément Contini Corey Bryant Darren Hague Doug Hellmann Emma Foley Erno Kuvaja Flavio Percoco Ghanshyam Mann Hanxi Liu Hervé Beraud Ivan Anfimov Julien Danjou Le Hou Luke Repko Mehdi Abaakouk Mona Nandwani Monty Taylor Nadya Privalova OpenStack Release Bot Rohit Jaiswal Romain LE DISEZ Romain Soufflet Romain de Joux Sean McGinnis Stephen Finucane Steve Lewis Swapnil Kulkarni (coolsvap) Takashi Kajinami Takashi Kajinami Thomas Bechtold Tom Cocozzello Tony Breeds Vu Cong Tuan Yandong Xuan Yuanbin.Chen ZhiQiang Fan aditi gengchc2 gord chung gordon chung jlarriba liushuobj niuke prankul mahajan sonu.kumar venkatamahesh xiaozhuangqing xuanyandong zhangboye zhouxinyong zhurong ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3670895 ceilometermiddleware-3.13.0/CONTRIBUTING.rst0000664000175000017500000000104715242062750017254 0ustar00zuulzuulIf you would like to contribute to the development of OpenStack, you must follow the steps in this page: http://docs.openstack.org/infra/manual/developers.html Once those steps have been completed, changes to OpenStack should be submitted for review via the Gerrit tool, following the workflow documented at: http://docs.openstack.org/infra/manual/developers.html#development-workflow Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad, not GitHub: https://bugs.launchpad.net/ceilometermiddleware ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1787323923.151359 ceilometermiddleware-3.13.0/ChangeLog0000664000175000017500000001731315242063023016362 0ustar00zuulzuulCHANGES ======= 3.13.0 ------ * Add irrelevant-files for skipping tempest tests * Emit swift storage policy in notifications 3.12.0 ------ * Do not install code to build release notes * Update target version in pyupgrade * Include subpackages in build * Drop Python 3.10 * Update packaging configuration * tox: Use new constraints option 3.11.0 ------ * cadf: add storage.api.request measurement * Update master for stable/2026.1 * Update gitignore to ignore md files for AI agents 3.10.0 ------ * Replace deprecated datetime.datetime.utcnow * tox: Do not quote posargs * pre-commit: Bump versions * Add project badge 3.9.0 ----- * reno: Update master for unmaintained/2024.1 * Bump pyupgrade target to 3.10+ * pre-commit: Bump versions * Migrate setup configuration to pyproject.toml * Install coverage only when needed * Update outdated default envlist * Update master for stable/2025.2 * Enable a few common hacking checks 3.8.0 ----- * Add release note about Python 3.9 removal * Drop explicit dependency on python-subunit * Remove Python 3.9 support * add pyproject.toml to support pip 23.1 * tox: Remove basepython * Drop redundant injection of VIRTUAL\_ENV * Run pyupgrade to clean up Python 2 syntaxes * Use pre-commit to run pep8 checks * Remove note about old pip's behavior 3.7.0 ----- * Update master for stable/2025.1 * Fix handling of empty reseller\_prefix 3.6.1 ----- * Update default envlist 3.6.0 ----- * reno: Update master for unmaintained/2023.1 * Add note about requirements lower bounds * Fix formatting of release list * Remove Python 3.8 support * Replacing the link in HACKING.rst * Update reno for stable/rocky * Revert "Disable global venv on the integration job" * Update master for stable/2024.2 * Add config file to generate separate middleware config file 3.5.0 ----- * If-else with same path in both directions * Remove old excludes * reno: Update master for unmaintained/zed * Print coverage report 3.4.0 ----- * Load additional config files for oslo.messaging options * reno: Update master for unmaintained/xena * reno: Update master for unmaintained/wallaby * reno: Update master for unmaintained/victoria * Update master for stable/2024.1 3.3.1 ----- * Fix releasenotes build of yoga moved to unmaintained * Bump hacking * Add doc/requirements 3.3.0 ----- * Update python classifier in setup.cfg * Remove unused six library * Ignore .eggs directory * Disable global venv on the integration job * Update master for stable/2023.1 * Update master for stable/2023.2 3.2.0 ----- * Add 'check\_requirements' to CI 3.1.0 ----- * Switch to 2023.1 Python3 unit tests and generic template name * Update master for stable/zed 3.0.0 ----- * remove unicode from code * Update python testing as per zed cycle testing runtime * Add Python 3.9 support to classifiers * Update master for stable/yoga 2.4.1 ----- * Add Python3 yoga unit tests 2.4.0 ----- * Update master for stable/xena * setup.cfg: Replace dashes with underscores * Add Python3 xena unit tests 2.3.0 ----- * Update master for stable/wallaby * Replace the following items with Python 3 style code 2.2.0 ----- * Add Python3 wallaby unit tests * Update master for stable/victoria 2.1.0 ----- * Switch to newer openstackdocstheme and reno versions * Further Cleanup py27 support * Bump default tox env from py37 to py38 * Add py38 package metadata * Use unittest.mock instead of third party mock * Add Python3 victoria unit tests * Update master for stable/ussuri * Use swift.backend\_path from Swift/s3api to extract account/container * Cleanup py27 support 2.0.0 ----- * Replace lib-forward-testing-plugin * Drop python 2.7 support and testing * Switch to Ussuri jobs * Drop oslosphinx and use openstackdocstheme * Update master for stable/train 1.5.0 ----- * Fix a socket leak in case of broken connection * Fix py37 test error * Add Python 3 Train unit tests * Use opendev repository * OpenDev Migration Patch * Dropping the py35 testing * Update master for stable/stein * Change openstack-dev to openstack-discuss 1.4.0 ----- * add python 3.6 unit test job * switch documentation job to new PTI * import zuul job settings from project-config * add release notes to readme.rst * Switch to stestr 1.3.0 ----- * fix tox python3 overrides * Update reno for stable/queens 1.2.0 ----- * Fix documentation url 404 error * Remove setting of version/release from releasenotes * Update reno for stable/pike * Fix default service project to "service" * retrieve project id to ignore from keystone 1.1.0 ----- * Switch to get\_notification\_transport for Notifier 1.0.1 ----- * Trivial: remove support for py34 * switch to topics when declaring notifier * Update reno for stable/ocata * Fix releasenotes branches * Use https instead of http for git.openstack.org * Remove link to modindex * [doc] Note lack of constraints is a choice * Revert "Show team and repo badges on README" * Show team and repo badges on README * Bump hacking to 0.12 1.0.0 ----- * Convert nonblocking\_notify value from string to boolean * No reason to start with '\_' define a general variable * Enable release notes translation * Clean imports in code * Bump the oslo.messaging version * clean up oslo-incubator related stuff * Add release note for background thread notifier * Delete openstack/common from the exclude list of flake8 in tox * Add reno for release notes management * Avoid useless dependency on oslo\_utils * Update the home-page with developer documentation * Fix bug in background sending * Add support for Python 3.5 * Remove py33 from tox envlist 0.5.0 ----- * Add background thread notifier sending ability * Upgrade hacking * Updated from global requirements * Only install hacking in pep8 * Remove oslo.context dependency * Remove unused requirements * Add missing requirements for mock * Updated from global requirements * [Trivial] Remove executable privilege of doc/source/conf.py * Updated from global requirements * Updated from global requirements * use path as resource id when missing RESELLER prefix 0.4.0 ----- * Updated from global requirements * Updated from global requirements * Updated from global requirements * Updated from global requirements * Updated from global requirements * Updated from global requirements * Use assertTrue/False instead of assertEqual(T/F) * Updated from global requirements * Removes MANIFEST.in as it is not needed explicitely by PBR * Remove py26 support from ceilometermiddleware * Updated from global requirements * Updated from global requirements * Updated from global requirements * Updated from global requirements * swift: upgrade messaging to v2 * Updated from global requirements * Updated from global requirements * Fix the mistakes in .gitignore file * Change ignore-errors to ignore\_errors 0.3.0 ----- * Ignore request with swift.source in env * Updated from global requirements * Fixes parsing req path for account HEAD/GET * HTTP\_X\_TENANT\_ID is deprecated and replaced by HTTP\_X\_PROJECT\_ID * Updated from global requirements * Activate pep8 check that \_ is imported * Updated from global requirements * Drop use of 'oslo' namespace package * Updated from global requirements * Add test which asserts non-empty target\_id * Updated from global requirements * add support to skip event/meter generation for certain projects * Set correct config choice for transport url 0.2.0 ----- * Updated from global requirements * Drop use of 'oslo' namespace package * Update README to work with release tools * Updated from global requirements * Add \*paste.filter\_factory\* entry point * use pycadf helper module to assign action * Updated from global requirements * remove gitignore files 0.1.0 ----- * add README template * add options to configure messaging * ignore changelog * fix py34 tests * fix gitignore * fix gitignore * initial checkin * initial checkin * Initial commit ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3670895 ceilometermiddleware-3.13.0/HACKING.rst0000664000175000017500000000025215242062750016406 0ustar00zuulzuulceilometermiddleware Style Commandments =============================================== Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3680897 ceilometermiddleware-3.13.0/LICENSE0000664000175000017500000002363715242062750015631 0ustar00zuulzuul Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3323593 ceilometermiddleware-3.13.0/PKG-INFO0000644000175000017500000000421115242063023015674 0ustar00zuulzuulMetadata-Version: 2.4 Name: ceilometermiddleware Version: 3.13.0 Summary: OpenStack Telemetry middleware for generating metrics Author-email: OpenStack License-Expression: Apache-2.0 Project-URL: Homepage, https://docs.openstack.org/ceilometermiddleware Project-URL: Repository, https://opendev.org/openstack/ceilometermiddleware Classifier: Environment :: OpenStack Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: System Administrators Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3.14 Requires-Python: >=3.11 Description-Content-Type: text/x-rst License-File: LICENSE Requires-Dist: oslo.config>=3.9.0 Requires-Dist: oslo.messaging>=5.2.0 Requires-Dist: oslo.utils>=4.7.0 Requires-Dist: pbr>=1.6 Requires-Dist: pycadf>=2.0.1 Requires-Dist: keystoneauth1>=2.18.0 Requires-Dist: python-keystoneclient>=3.8.0 Dynamic: license-file Dynamic: requires-dist =============================================== Middleware for OpenStack Telemetry (Ceilometer) =============================================== .. image:: https://governance.openstack.org/tc/badges/ceilometermiddleware.svg This library provides middleware modules designed to enable metric and event data generation to be consumed by Ceilometer. For information on contributing, see ``CONTRIBUTING.rst``. * License: Apache License, Version 2.0 * Documentation: https://docs.openstack.org/ceilometermiddleware/latest/ * Source: http://opendev.org/openstack/ceilometermiddleware * Bugs: http://bugs.launchpad.net/ceilometermiddleware * Release notes: https://docs.openstack.org/releasenotes/ceilometermiddleware/ For any other information, refer to the parent project, Ceilometer: https://opendev.org/openstack/ceilometer ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3680897 ceilometermiddleware-3.13.0/README.rst0000664000175000017500000000147615242062750016310 0ustar00zuulzuul=============================================== Middleware for OpenStack Telemetry (Ceilometer) =============================================== .. image:: https://governance.openstack.org/tc/badges/ceilometermiddleware.svg This library provides middleware modules designed to enable metric and event data generation to be consumed by Ceilometer. For information on contributing, see ``CONTRIBUTING.rst``. * License: Apache License, Version 2.0 * Documentation: https://docs.openstack.org/ceilometermiddleware/latest/ * Source: http://opendev.org/openstack/ceilometermiddleware * Bugs: http://bugs.launchpad.net/ceilometermiddleware * Release notes: https://docs.openstack.org/releasenotes/ceilometermiddleware/ For any other information, refer to the parent project, Ceilometer: https://opendev.org/openstack/ceilometer ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3233593 ceilometermiddleware-3.13.0/ceilometermiddleware/0000775000175000017500000000000015242063023020771 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3680897 ceilometermiddleware-3.13.0/ceilometermiddleware/__init__.py0000664000175000017500000000121315242062750023105 0ustar00zuulzuul# 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. import pbr.version __version__ = pbr.version.VersionInfo( 'ceilometermiddleware').version_string() ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3690896 ceilometermiddleware-3.13.0/ceilometermiddleware/swift.py0000664000175000017500000005202215242062750022506 0ustar00zuulzuul# # Copyright 2012 eNovance # # 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. """ Telemetry Middleware for Swift Proxy Configuration: In /etc/swift/proxy-server.conf on the main pipeline add "ceilometer" just before "proxy-server" and add the following filter in the file: .. code-block:: python [filter:ceilometer] paste.filter_factory = ceilometermiddleware.swift:filter_factory # Some optional configuration this allow to publish additional metadata metadata_headers = X-TEST # Set reseller prefix (defaults to "AUTH_" if not set) reseller_prefix = AUTH_ # Path to the swift configuration file containing storage policy # definitions. Used to enrich events with storage policy name and # type; falls back to policy_idx alone if the file cannot be read. swift_conf_file = /etc/swift/swift.conf # Set control_exchange to publish to. control_exchange = swift # Set transport url url = rabbit://me:passwd@host:5672/virtual_host # set messaging driver driver = messagingv2 # set topic topic = notifications # skip metering of requests from listed project ids ignore_projects = , , # Whether to send events to messaging driver in a background thread nonblocking_notify = False # Queue size for sending notifications in background thread (0=unlimited). # New notifications will be discarded if the queue is full. send_queue_size = 1000 # Logging level control log_level = WARNING # All keystoneauth1 options can be set to query project name for # ignore_projects option, here is just a example: auth_type = password auth_url = https://[::1]:5000 project_name = service project_domain_name = Default username = user user_domain_name = Default password = a_big_secret interface = public """ import configparser import functools import logging from keystoneauth1 import exceptions as ksa_exc from keystoneauth1.loading import adapter as ksa_adapter from keystoneauth1.loading import base as ksa_base from keystoneauth1.loading import session as ksa_session from keystoneclient.v3 import client as ks_client from oslo_config import cfg import oslo_messaging from oslo_utils import strutils from oslo_utils import timeutils from pycadf import event as cadf_event from pycadf.helper import api from pycadf import measurement as cadf_measurement from pycadf import metric as cadf_metric from pycadf import resource as cadf_resource import queue import threading import urllib.parse as urlparse LOG = logging.getLogger(__name__) # Swift's implicit default when no storage policies are declared in # swift.conf. Mirrored here as constants to enrich policy_idx without # importing from the swift package. _LEGACY_POLICY_NAME = 'Policy-0' _DEFAULT_POLICY_TYPE = 'replication' _STORAGE_POLICY_SECTION_PREFIX = 'storage-policy:' def list_from_csv(comma_separated_str): if comma_separated_str: return list( filter(lambda x: x, map(lambda x: x.strip(), comma_separated_str.split(',')))) return [] def _log_and_ignore_error(fn): @functools.wraps(fn) def wrapper(*args, **kwargs): try: return fn(*args, **kwargs) except Exception as e: LOG.exception('An exception occurred processing ' 'the API call: %s ', e) return wrapper class InputProxy: """File-like object that counts bytes read. To be swapped in for wsgi.input for accounting purposes. Borrowed from swift.common.utils. Duplicated here to avoid dependency on swift package. """ def __init__(self, wsgi_input): self.wsgi_input = wsgi_input self.bytes_received = 0 def read(self, *args, **kwargs): """Pass read request to the underlying file-like object Add bytes read to total. """ chunk = self.wsgi_input.read(*args, **kwargs) self.bytes_received += len(chunk) return chunk def readline(self, *args, **kwargs): """Pass readline request to the underlying file-like object Add bytes read to total. """ line = self.wsgi_input.readline(*args, **kwargs) self.bytes_received += len(line) return line def close(self): close_method = getattr(self.wsgi_input, 'close', None) if callable(close_method): close_method() class KeystoneClientLoader(ksa_adapter.Adapter): """Keystone client adapter loader. Keystone client and Keystoneauth1 adapter take exactly the same options, so it's safe to create a keystone client with keystoneauth adapter options. """ @property def plugin_class(self): return ks_client.Client class Swift: """Swift middleware used for counting requests.""" event_queue = None threadLock = threading.Lock() DEFAULT_IGNORE_PROJECT_NAMES = ['service'] def __init__(self, app, conf): self._app = app self.ignore_projects = self._get_ignore_projects(conf) extra_config_files = conf.get('extra_config_files') if extra_config_files is not None: extra_config_files = list_from_csv(extra_config_files) extra_config_dirs = conf.get('extra_config_dirs') if extra_config_dirs is not None: extra_config_dirs = list_from_csv(extra_config_dirs) oslo_conf = cfg.ConfigOpts() oslo_conf([], project='swift', default_config_files=extra_config_files, default_config_dirs=extra_config_dirs, validate_default_values=True) oslo_messaging.set_transport_defaults(conf.get('control_exchange', 'swift')) self._notifier = oslo_messaging.Notifier( oslo_messaging.get_notification_transport(oslo_conf, url=conf.get('url')), publisher_id='ceilometermiddleware', driver=conf.get('driver', 'messagingv2'), topics=[conf.get('topic', 'notifications')]) self.metadata_headers = [h.strip().replace('-', '_').lower() for h in conf.get( "metadata_headers", "").split(",") if h.strip()] self.reseller_prefix = conf.get('reseller_prefix', 'AUTH_') if self.reseller_prefix and self.reseller_prefix[-1] != '_': self.reseller_prefix += '_' LOG.setLevel(getattr(logging, conf.get('log_level', 'WARNING'))) # NOTE: If the background thread's send queue fills up, the event will # be discarded # # For backward compatibility we default to False and therefore wait for # sending to complete. This causes swift proxy to hang if the # destination is unavailable. self.nonblocking_notify = strutils.bool_from_string( conf.get('nonblocking_notify', False)) # Initialize the sending queue and thread, but only once if self.nonblocking_notify and Swift.event_queue is None: Swift.threadLock.acquire() if Swift.event_queue is None: send_queue_size = int(conf.get('send_queue_size', 1000)) Swift.event_queue = queue.Queue(send_queue_size) self.start_sender_thread() Swift.threadLock.release() self._policies = self._load_storage_policies( conf.get('swift_conf_file', '/etc/swift/swift.conf')) def _get_ignore_projects(self, conf): if 'auth_type' not in conf: LOG.info("'auth_type' is not set assuming ignore_projects are " "only project uuid.") return list_from_csv(conf.get('ignore_projects')) if 'ignore_projects' in conf: ignore_projects = list_from_csv(conf.get('ignore_projects')) else: ignore_projects = self.DEFAULT_IGNORE_PROJECT_NAMES if not ignore_projects: return [] def opt_getter(opt): # TODO(sileht): This method does not support deprecated opt names val = conf.get(opt.name) if val is None: val = conf.get(opt.dest) return val auth_type = conf.get('auth_type') plugin = ksa_base.get_plugin_loader(auth_type) auth = plugin.load_from_options_getter(opt_getter) session = ksa_session.Session().load_from_options_getter( opt_getter, auth=auth) client = KeystoneClientLoader().load_from_options_getter( opt_getter, session=session) projects = [] for name_or_id in ignore_projects: projects.extend(self._get_keystone_projects(client, name_or_id)) return projects @staticmethod def _load_storage_policies(path): """Parse a swift configuration file into ``{idx: (name, type)}``. Reads ``[storage-policy:N]`` sections; ``policy_type`` defaults to ``replication`` when omitted, matching swift. When the file is readable but declares no policies, the map is populated with the implicit ``Policy-0`` default swift itself synthesizes in that case. When the file is missing or unparseable the map is empty and emitted events carry ``policy_idx`` alone. """ # Python disallows section or option duplicates by default; # strict=False mirrors swift's own storage policy parser. parser = configparser.RawConfigParser(strict=False) try: with open(path) as fp: parser.read_file(fp) except FileNotFoundError: LOG.info( 'Swift configuration file not found at %s; ' 'policy_name and policy_type will be omitted ' 'from events.', path) return {} except (OSError, configparser.Error) as e: LOG.warning( 'Unable to parse swift configuration file %s: %s. ' 'policy_name and policy_type will be omitted from ' 'events.', path, e) return {} policies = {} for section in parser.sections(): if not section.startswith(_STORAGE_POLICY_SECTION_PREFIX): continue try: idx = int(section[len(_STORAGE_POLICY_SECTION_PREFIX):]) except ValueError: continue name = parser.get(section, 'name', fallback=None) if not name: continue policy_type = parser.get( section, 'policy_type', fallback=_DEFAULT_POLICY_TYPE) policies[idx] = (name, policy_type) if not policies: # Match swift's implicit default when the config declares # no storage policies. LOG.debug( '%s declares no storage policies; using the implicit ' 'Policy-0 default.', path) policies[0] = (_LEGACY_POLICY_NAME, _DEFAULT_POLICY_TYPE) else: LOG.debug('Loaded storage policies from %s: %s', path, sorted(policies)) return policies @staticmethod def _get_policy_idx(env, container, obj, resp_headers=None): """Return the Swift storage policy index as a string, or None. Sources consulted in order: * ``env['HTTP_X_BACKEND_STORAGE_POLICY_INDEX']`` for object requests. The proxy's object controller stamps this on ``req.headers`` before backend dispatch. Container handlers do not, so a client-supplied value there could be spoofed and is ignored. * ``X-Backend-Storage-Policy-Index`` on the response headers. Swift's container server includes this on GET/HEAD/PUT responses. Returns None for account-level requests, container POST/DELETE (which carry no policy header), pre-controller failures, and unparseable values. For SLO and COPY the index reflects the container the metered request acted on, not any segment or source containers involved internally; requests routed by path-rewriting middleware (like versioned writes) reflect the rewritten container. """ if not container: return None idx = None # Only trust the env header for object requests; container # handlers do not overwrite a client-supplied value. if obj: idx = env.get('HTTP_X_BACKEND_STORAGE_POLICY_INDEX') or None if idx is None and resp_headers: idx = next( (v for k, v in resp_headers if v and k.lower() == 'x-backend-storage-policy-index'), None) if idx is None: return None try: # Validate as an integer but emit as a canonical string so # downstream consumers (ceilometer) parse a consistent type. return str(int(idx)) except (TypeError, ValueError): LOG.debug('Unparseable storage policy index %r', idx) return None @staticmethod def _get_keystone_projects(client, name_or_id): try: return [client.projects.get(name_or_id)] except ksa_exc.NotFound: pass if isinstance(name_or_id, bytes): name_or_id = name_or_id.decode('utf-8', 'strict') projects = client.projects.list(name=name_or_id) if not projects: LOG.warning("fail to find project '%s' in keystone", name_or_id) return [p.id for p in projects] def __call__(self, env, start_response): start_response_args = [None] input_proxy = InputProxy(env['wsgi.input']) env['wsgi.input'] = input_proxy def my_start_response(status, headers, exc_info=None): start_response_args[0] = (status, list(headers), exc_info) def iter_response(iterable): iterator = iter(iterable) try: chunk = next(iterator) while not chunk: chunk = next(iterator) except StopIteration: chunk = '' if start_response_args[0]: start_response(*start_response_args[0]) bytes_sent = 0 try: while chunk: bytes_sent += len(chunk) yield chunk try: chunk = next(iterator) except StopIteration: chunk = '' finally: close_method = getattr(iterable, 'close', None) if callable(close_method): close_method() resp_headers = (start_response_args[0][1] if start_response_args[0] else None) self.emit_event(env, input_proxy.bytes_received, bytes_sent, resp_headers=resp_headers) try: iterable = self._app(env, my_start_response) except Exception: self.emit_event(env, input_proxy.bytes_received, 0, 'failure') raise else: return iter_response(iterable) @_log_and_ignore_error def emit_event(self, env, bytes_received, bytes_sent, outcome='success', resp_headers=None): if ( (env.get('HTTP_X_SERVICE_PROJECT_ID') or env.get('HTTP_X_PROJECT_ID') or env.get('HTTP_X_TENANT_ID')) in self.ignore_projects or env.get('swift.source') is not None): return path = urlparse.quote(env.get('swift.backend_path', env['PATH_INFO'])) method = env['REQUEST_METHOD'] headers = {} for header in env: if header.startswith('HTTP_') and env[header]: key = header[5:] headers[key] = str(env[header]) try: container = obj = None path = path.replace('/', '', 1) version, account, remainder = path.split('/', 2) except ValueError: try: version, account = path.split('/', 1) remainder = None except ValueError: return try: if not version or not account: raise ValueError('Invalid path: %s' % path) if remainder: if '/' in remainder: container, obj = remainder.split('/', 1) else: container = remainder except ValueError: return now = timeutils.utcnow().isoformat() resource_metadata = { "path": path, "version": version, "container": container, "object": obj, } policy_idx = self._get_policy_idx( env, container, obj, resp_headers) if policy_idx is not None: resource_metadata["policy_idx"] = policy_idx policy_info = self._policies.get(int(policy_idx)) if policy_info: policy_name, policy_type = policy_info resource_metadata["policy_name"] = policy_name resource_metadata["policy_type"] = policy_type for header in self.metadata_headers: if header.upper() in headers: resource_metadata['http_header_%s' % header] = headers.get( header.upper()) # build object store details if self.reseller_prefix: resource_id = account.partition(self.reseller_prefix)[2] or path else: resource_id = account target = cadf_resource.Resource( typeURI='service/storage/object', id=resource_id) target.metadata = resource_metadata target.action = method.lower() # build user details initiator = cadf_resource.Resource( typeURI='service/security/account/user', id=env.get('HTTP_X_USER_ID')) initiator.project_id = (env.get('HTTP_X_PROJECT_ID') or env.get('HTTP_X_TENANT_ID')) # build notification body event = cadf_event.Event(eventTime=now, outcome=outcome, action=api.convert_req_action(method), initiator=initiator, target=target, observer=cadf_resource.Resource(id='target')) # measurements event.add_measurement(cadf_measurement.Measurement( result=1, metric=cadf_metric.Metric( name='storage.api.request', unit='request'))) if bytes_received: event.add_measurement(cadf_measurement.Measurement( result=bytes_received, metric=cadf_metric.Metric( name='storage.objects.incoming.bytes', unit='B'))) if bytes_sent: event.add_measurement(cadf_measurement.Measurement( result=bytes_sent, metric=cadf_metric.Metric( name='storage.objects.outgoing.bytes', unit='B'))) if self.nonblocking_notify: try: Swift.event_queue.put(event, False) if not Swift.event_sender.is_alive(): Swift.threadLock.acquire() self.start_sender_thread() Swift.threadLock.release() except queue.Full: LOG.warning('Send queue FULL: Event %s not added', event.id) else: Swift.send_notification(self._notifier, event) def start_sender_thread(self): Swift.event_sender = SendEventThread(self._notifier) Swift.event_sender.daemon = True Swift.event_sender.start() @staticmethod def send_notification(notifier, event): notifier.info({}, 'objectstore.http.request', event.as_dict()) class SendEventThread(threading.Thread): def __init__(self, notifier): super().__init__() self.notifier = notifier def run(self): """Send events without blocking swift proxy.""" while True: try: LOG.debug('Wait for event from send queue') event = Swift.event_queue.get() LOG.debug('Got event %s from queue - now send it', event.id) Swift.send_notification(self.notifier, event) LOG.debug('Event %s sent.', event.id) except BaseException: LOG.exception("SendEventThread loop exception") def filter_factory(global_conf, **local_conf): conf = global_conf.copy() conf.update(local_conf) def filter(app): return Swift(app, conf) return filter ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3253593 ceilometermiddleware-3.13.0/ceilometermiddleware/tests/0000775000175000017500000000000015242063023022133 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3690896 ceilometermiddleware-3.13.0/ceilometermiddleware/tests/__init__.py0000664000175000017500000000000015242062750024240 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3700895 ceilometermiddleware-3.13.0/ceilometermiddleware/tests/base.py0000664000175000017500000000140115242062750023421 0ustar00zuulzuul# Copyright 2010-2011 OpenStack Foundation # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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. from oslotest import base class TestCase(base.BaseTestCase): """Test case base class for all unit tests.""" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3253593 ceilometermiddleware-3.13.0/ceilometermiddleware/tests/data/0000775000175000017500000000000015242063023023044 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3700895 ceilometermiddleware-3.13.0/ceilometermiddleware/tests/data/list_projects.yaml0000664000175000017500000003450515242062750026631 0ustar00zuulzuulhttp_interactions: - recorded_at: '2017-05-15T07:49:52' request: body: encoding: utf-8 string: |- { "auth": { "tenantName": "dummy", "passwordCredentials": { "username": "dummy", "password": "********" } } } headers: Accept: - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive Content-Length: - '107' Content-Type: - application/json User-Agent: - run.py keystoneauth1/2.20.0 python-requests/2.14.2 CPython/2.7.13 method: POST uri: https://[::1]:5000/v2.0/tokens response: body: encoding: null string: |- { "access": { "serviceCatalog": [ { "type": "compute", "endpoints_links": [], "name": "nova", "endpoints": [ { "internalURL": "https://[::1]:8774/v2.1", "adminURL": "https://[::1]:8774/v2.1", "id": "1e879ab434b54b8abfd275feeb2ef9f3", "region": "RegionOne", "publicURL": "https://[::1]:8774/v2.1" } ] }, { "type": "network", "endpoints_links": [], "name": "neutron", "endpoints": [ { "internalURL": "http://[::1]:9696", "adminURL": "http://[::1]:9696", "id": "83fcb786f646437f9a61cef72a9e43d7", "region": "RegionOne", "publicURL": "http://[::1]:9696" } ] }, { "type": "volumev2", "endpoints_links": [], "name": "cinderv2", "endpoints": [ { "internalURL": "https://[::1]:8776/v2/ed980105f9d047e2bee738b3f261f126", "adminURL": "https://[::1]:8776/v2/ed980105f9d047e2bee738b3f261f126", "id": "973ef665c2ea4ec3b5c3d48932fad7a4", "region": "RegionOne", "publicURL": "https://[::1]:8776/v2/ed980105f9d047e2bee738b3f261f126" } ] }, { "type": "volumev3", "endpoints_links": [], "name": "cinderv3", "endpoints": [ { "internalURL": "https://[::1]:8776/v3/ed980105f9d047e2bee738b3f261f126", "adminURL": "https://[::1]:8776/v3/ed980105f9d047e2bee738b3f261f126", "id": "0e80fe643d4d44729db99d0a5c882d1b", "region": "RegionOne", "publicURL": "https://[::1]:8776/v3/ed980105f9d047e2bee738b3f261f126" } ] }, { "type": "image", "endpoints_links": [], "name": "glance", "endpoints": [ { "internalURL": "http://[::1]:9292", "adminURL": "http://[::1]:9292", "id": "7aad24b660a94254adc3546e4de4d668", "region": "RegionOne", "publicURL": "http://[::1]:9292" } ] }, { "type": "volume", "endpoints_links": [], "name": "cinder", "endpoints": [ { "internalURL": "https://[::1]:8776/v1/ed980105f9d047e2bee738b3f261f126", "adminURL": "https://[::1]:8776/v1/ed980105f9d047e2bee738b3f261f126", "id": "8191ee00b695483796a9531bca70279b", "region": "RegionOne", "publicURL": "https://[::1]:8776/v1/ed980105f9d047e2bee738b3f261f126" } ] }, { "type": "identity", "endpoints_links": [], "name": "keystone", "endpoints": [ { "internalURL": "https://[::1]:5000", "adminURL": "https://[::1]:35357", "id": "24ab268f1a7b47d4af493c4c74cd6130", "region": "RegionOne", "publicURL": "https://[::1]:5000" } ] } ], "user": { "username": "dummy", "roles_links": [], "id": "f18b121edda04346b86610fa23983a0e", "roles": [ { "name": "admin" } ], "name": "dummy" }, "token": { "issued_at": "2017-05-15T07:49:52.000000Z", "tenant": { "enabled": true, "id": "ed980105f9d047e2bee738b3f261f126", "name": "dummy", "description": "admin tenant" }, "audit_ids": [ "VzK7yoNFT0qlUWg5KhDuMQ" ], "expires": "9999-12-31T23:59:59Z", "id": "gAAAAABZGV2gZwV0SlycA_OIohX7kRAmTp84SnzsAYD5Uhey7RTzCf0NvxNRxLk5RsjRSMncSdro7eWgtMrSblZJCPl485IvHANL3E3gsxFJP9TjebqDiF4DtGhQmc4mHPB3kOBNzg3v2FrHB2hK77Cc4M7V1Pm_-nWBHxYxVNopVhrd80Y4-2c" }, "metadata": { "is_admin": 0, "roles": [ "d3b61a4656d64cbbbdb0f13690e2ffe4" ] } } } headers: Connection: - Keep-Alive Content-Length: - '3183' Content-Type: - application/json Date: - Mon, 15 May 2017 07:49:51 GMT Keep-Alive: - timeout=3, max=100 Server: - Apache/2.4.18 (Ubuntu) Strict-Transport-Security: - max-age=15768000 Vary: - X-Auth-Token X-Distribution: - Ubuntu x-openstack-request-id: - req-84cb5714-49dc-4bab-93ba-2b66ba566c30 status: code: 200 message: OK url: https://[::1]:5000/v2.0/tokens - recorded_at: '2017-05-15T07:49:53' request: body: encoding: utf-8 string: '' headers: Accept: - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - run.py keystoneauth1/2.20.0 python-requests/2.14.2 CPython/2.7.13 method: GET uri: https://[::1]:35357/ response: body: encoding: null string: |- { "versions": { "values": [ { "status": "stable", "updated": "2016-10-06T00:00:00Z", "id": "v3.7", "links": [ { "rel": "self", "href": "https://[::1]:35357/v3/" } ], "media-types": [ { "type": "application/vnd.openstack.identity-v3+json", "base": "application/json" } ] }, { "status": "deprecated", "updated": "2016-08-04T00:00:00Z", "id": "v2.0", "links": [ { "rel": "self", "href": "https://[::1]:35357/v2.0/" }, { "type": "text/html", "rel": "describedby", "href": "http://docs.openstack.org/" } ], "media-types": [ { "type": "application/vnd.openstack.identity-v2.0+json", "base": "application/json" } ] } ] } } headers: Connection: - Keep-Alive Content-Length: - '627' Content-Type: - application/json Date: - Mon, 15 May 2017 07:49:52 GMT Keep-Alive: - timeout=3, max=100 Server: - Apache/2.4.18 (Ubuntu) Strict-Transport-Security: - max-age=15768000 Vary: - X-Auth-Token X-Distribution: - Ubuntu status: code: 300 message: Multiple Choices url: https://[::1]:35357/ - recorded_at: '2017-05-15T07:49:53' request: body: encoding: utf-8 string: '' headers: Accept: - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - python-keystoneclient X-Auth-Token: - gAAAAABZGV2gZwV0SlycA_OIohX7kRAmTp84SnzsAYD5Uhey7RTzCf0NvxNRxLk5RsjRSMncSdro7eWgtMrSblZJCPl485IvHANL3E3gsxFJP9TjebqDiF4DtGhQmc4mHPB3kOBNzg3v2FrHB2hK77Cc4M7V1Pm_-nWBHxYxVNopVhrd80Y4-2c method: GET uri: https://[::1]:35357/v3/projects/service response: body: encoding: null string: |- { "error": { "code": 404, "title": "Not Found", "message": "Could not find project: service" } } headers: Connection: - Keep-Alive Content-Length: - '93' Content-Type: - application/json Date: - Mon, 15 May 2017 07:49:53 GMT Keep-Alive: - timeout=3, max=99 Server: - Apache/2.4.18 (Ubuntu) Strict-Transport-Security: - max-age=15768000 Vary: - X-Auth-Token X-Distribution: - Ubuntu x-openstack-request-id: - req-6107025c-e09e-437a-90c2-61a559154d32 status: code: 404 message: Not Found url: https://[::1]:35357/v3/projects/service - recorded_at: '2017-05-15T07:49:53' request: body: encoding: utf-8 string: '' headers: Accept: - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - python-keystoneclient X-Auth-Token: - gAAAAABZGV2gZwV0SlycA_OIohX7kRAmTp84SnzsAYD5Uhey7RTzCf0NvxNRxLk5RsjRSMncSdro7eWgtMrSblZJCPl485IvHANL3E3gsxFJP9TjebqDiF4DtGhQmc4mHPB3kOBNzg3v2FrHB2hK77Cc4M7V1Pm_-nWBHxYxVNopVhrd80Y4-2c method: GET uri: https://[::1]:35357/v3/projects?name=service response: body: encoding: null string: |- { "projects": [ { "enabled": true, "id": "147cc0a9263c4964926f3ee7b6ba3685", "domain_id": "default", "parent_id": "default", "is_domain": false, "name": "service", "links": { "self": "https://[::1]:5000/v3/projects/147cc0a9263c4964926f3ee7b6ba3685" }, "description": "Tenant for the openstack service" } ], "links": { "self": "https://[::1]:5000/v3/projects?name=service", "next": null, "previous": null } } headers: Connection: - Keep-Alive Content-Length: - '440' Content-Type: - application/json Date: - Mon, 15 May 2017 07:49:53 GMT Keep-Alive: - timeout=3, max=98 Server: - Apache/2.4.18 (Ubuntu) Strict-Transport-Security: - max-age=15768000 Vary: - X-Auth-Token X-Distribution: - Ubuntu x-openstack-request-id: - req-1915b2be-f116-4831-a7c3-5ba0a32d416f status: code: 200 message: OK url: https://[::1]:35357/v3/projects?name=service - recorded_at: '2017-05-15T07:49:53' request: body: encoding: utf-8 string: '' headers: Accept: - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - python-keystoneclient X-Auth-Token: - gAAAAABZGV2gZwV0SlycA_OIohX7kRAmTp84SnzsAYD5Uhey7RTzCf0NvxNRxLk5RsjRSMncSdro7eWgtMrSblZJCPl485IvHANL3E3gsxFJP9TjebqDiF4DtGhQmc4mHPB3kOBNzg3v2FrHB2hK77Cc4M7V1Pm_-nWBHxYxVNopVhrd80Y4-2c method: GET uri: https://[::1]:35357/v3/projects/gnocchi response: body: encoding: null string: |- { "error": { "code": 404, "title": "Not Found", "message": "Could not find project: gnocchi" } } headers: Connection: - Keep-Alive Content-Length: - '92' Content-Type: - application/json Date: - Mon, 15 May 2017 07:49:53 GMT Keep-Alive: - timeout=3, max=97 Server: - Apache/2.4.18 (Ubuntu) Strict-Transport-Security: - max-age=15768000 Vary: - X-Auth-Token X-Distribution: - Ubuntu x-openstack-request-id: - req-b23e72d3-742e-4e10-b9a7-d1161f1eeab4 status: code: 404 message: Not Found url: https://[::1]:35357/v3/projects/gnocchi - recorded_at: '2017-05-15T07:49:53' request: body: encoding: utf-8 string: '' headers: Accept: - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive User-Agent: - python-keystoneclient X-Auth-Token: - gAAAAABZGV2gZwV0SlycA_OIohX7kRAmTp84SnzsAYD5Uhey7RTzCf0NvxNRxLk5RsjRSMncSdro7eWgtMrSblZJCPl485IvHANL3E3gsxFJP9TjebqDiF4DtGhQmc4mHPB3kOBNzg3v2FrHB2hK77Cc4M7V1Pm_-nWBHxYxVNopVhrd80Y4-2c method: GET uri: https://[::1]:35357/v3/projects?name=gnocchi response: body: encoding: null string: |- { "projects": [], "links": { "self": "https://[::1]:5000/v3/projects?name=gnocchi", "next": null, "previous": null } } headers: Connection: - Keep-Alive Content-Length: - '134' Content-Type: - application/json Date: - Mon, 15 May 2017 07:49:53 GMT Keep-Alive: - timeout=3, max=96 Server: - Apache/2.4.18 (Ubuntu) Strict-Transport-Security: - max-age=15768000 Vary: - X-Auth-Token X-Distribution: - Ubuntu x-openstack-request-id: - req-fdeed726-18a4-4e73-bf8d-d24a5b56246e status: code: 200 message: OK url: https://[::1]:35357/v3/projects?name=gnocchi recorded_with: betamax/0.8.0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3700895 ceilometermiddleware-3.13.0/ceilometermiddleware/tests/test_swift.py0000664000175000017500000011417515242062750024717 0ustar00zuulzuul# # Copyright 2012 eNovance # # 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. from io import StringIO import os import tempfile import threading import unittest from unittest import mock from oslo_config import cfg from ceilometermiddleware import swift from ceilometermiddleware.tests import base as tests_base from keystoneauth1.fixture import keystoneauth_betamax as betamax class FakeApp: def __init__(self, body=None): self.body = body or ['This string is 28 bytes long'] def __call__(self, env, start_response): yield start_response('200 OK', [ ('Content-Type', 'text/plain'), ('Content-Length', str(sum(map(len, self.body)))) ]) while env['wsgi.input'].read(5): pass yield from self.body class FakeAppWithHeaders(FakeApp): """FakeApp variant that emits additional response headers.""" def __init__(self, extra_headers, body=None): super().__init__(body=body) self.extra_headers = extra_headers def __call__(self, env, start_response): yield start_response('200 OK', [ ('Content-Type', 'text/plain'), ('Content-Length', str(sum(map(len, self.body)))), *self.extra_headers, ]) while env['wsgi.input'].read(5): pass yield from self.body class FakeRequest: """A bare bones request object The middleware will inspect this for request method, wsgi.input and headers. """ def __init__(self, path, environ=None, headers=None): environ = environ or {} headers = headers or {} environ['PATH_INFO'] = path if 'wsgi.input' not in environ: environ['wsgi.input'] = StringIO('') for header, value in headers.items(): environ['HTTP_%s' % header.upper()] = value self.environ = environ @mock.patch('oslo_messaging.get_transport', mock.MagicMock()) class TestSwift(tests_base.TestCase): def setUp(self): super().setUp() cfg.CONF([], project='ceilometermiddleware') self.addCleanup(cfg.CONF.reset) @staticmethod def start_response(*args): pass def get_request(self, path, environ=None, headers=None): return FakeRequest(path, environ=environ, headers=headers) # ---- helpers for new storage.api.request metric ---- @staticmethod def _measurements(payload): return payload.get('measurements') or [] def _find_measurement(self, payload, metric_name): for m in self._measurements(payload): if m.get('metric', {}).get('name') == metric_name: return m self.fail( "Missing measurement '{}'. Got: {}".format( metric_name, [ mm.get('metric', {}).get('name') for mm in self._measurements(payload) ] ) ) def _assert_has_api_request(self, payload, result=1): m = self._find_measurement(payload, 'storage.api.request') self.assertEqual(result, m.get('result')) def _assert_no_bytes_metrics(self, payload): byte_metrics = { 'storage.objects.incoming.bytes', 'storage.objects.outgoing.bytes', } self.assertFalse( any(m.get('metric', {}).get('name') in byte_metrics for m in self._measurements(payload)) ) # ---- tests ---- def test_get(self): app = swift.Swift(FakeApp(), {}) req = self.get_request('/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: resp = app(req.environ, self.start_response) self.assertEqual(["This string is 28 bytes long"], list(resp)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) self._assert_has_api_request(data[2], result=1) bytes_m = self._find_measurement( data[2], 'storage.objects.outgoing.bytes', ) self.assertEqual(28, bytes_m['result']) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertEqual('obj', metadata['object']) self.assertEqual('get', data[2]['target']['action']) def test_get_background(self): notified = threading.Event() app = swift.Swift(FakeApp(), {"nonblocking_notify": "True", "send_queue_size": "1"}) req = self.get_request('/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info', side_effect=lambda *args, **kwargs: notified.set() ) as notify: resp = app(req.environ, self.start_response) self.assertEqual(["This string is 28 bytes long"], list(resp)) notified.wait() self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) self._assert_has_api_request(data[2], result=1) bytes_m = self._find_measurement( data[2], 'storage.objects.outgoing.bytes', ) self.assertEqual(28, bytes_m['result']) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertEqual('obj', metadata['object']) self.assertEqual('get', data[2]['target']['action']) def test_put(self): app = swift.Swift(FakeApp(body=['']), {}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'PUT', 'wsgi.input': StringIO('some stuff')}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) self._assert_has_api_request(data[2], result=1) bytes_m = self._find_measurement( data[2], 'storage.objects.incoming.bytes', ) self.assertEqual(10, bytes_m['result']) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertEqual('obj', metadata['object']) self.assertEqual('put', data[2]['target']['action']) def test_post(self): app = swift.Swift(FakeApp(body=['']), {}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'POST', 'wsgi.input': StringIO('some other stuff')}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) self._assert_has_api_request(data[2], result=1) bytes_m = self._find_measurement( data[2], 'storage.objects.incoming.bytes', ) self.assertEqual(16, bytes_m['result']) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertEqual('obj', metadata['object']) self.assertEqual('post', data[2]['target']['action']) def test_head(self): app = swift.Swift(FakeApp(body=['']), {}) req = self.get_request('/1.0/account/container/obj', environ={'REQUEST_METHOD': 'HEAD'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) # request metric present, no bytes metrics self._assert_has_api_request(data[2], result=1) self._assert_no_bytes_metrics(data[2]) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertEqual('obj', metadata['object']) self.assertEqual('head', data[2]['target']['action']) def test_bogus_request(self): """Test even for arbitrary request method, this will still work.""" app = swift.Swift(FakeApp(body=['']), {}) req = self.get_request('/1.0/account/container/obj', environ={'REQUEST_METHOD': 'BOGUS'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) # Bogus methods still count as an API request self._assert_has_api_request(data[2], result=1) self._assert_no_bytes_metrics(data[2]) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertEqual('obj', metadata['object']) self.assertEqual('bogus', data[2]['target']['action']) def test_get_container(self): app = swift.Swift(FakeApp(), {}) req = self.get_request('/1.0/account/container', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) self._assert_has_api_request(data[2], result=1) bytes_m = self._find_measurement( data[2], 'storage.objects.outgoing.bytes', ) self.assertEqual(28, bytes_m['result']) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertIsNone(metadata['object']) self.assertEqual('get', data[2]['target']['action']) def test_no_metadata_headers(self): app = swift.Swift(FakeApp(), {}) req = self.get_request('/1.0/account/container', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) self._assert_has_api_request(data[2], result=1) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertIsNone(metadata['object']) self.assertEqual('get', data[2]['target']['action']) http_headers = [k for k in metadata.keys() if k.startswith('http_header_')] self.assertEqual(0, len(http_headers)) def test_metadata_headers(self): app = swift.Swift(FakeApp(), { 'metadata_headers': 'X_VAR1, x-var2, x-var3, token' }) req = self.get_request('/1.0/account/container', environ={'REQUEST_METHOD': 'GET'}, headers={'X_VAR1': 'value1', 'X_VAR2': 'value2', 'TOKEN': 'token'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) self._assert_has_api_request(data[2], result=1) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertIsNone(metadata['object']) self.assertEqual('get', data[2]['target']['action']) http_headers = [k for k in metadata.keys() if k.startswith('http_header_')] self.assertEqual(3, len(http_headers)) self.assertEqual('value1', metadata['http_header_x_var1']) self.assertEqual('value2', metadata['http_header_x_var2']) self.assertEqual('token', metadata['http_header_token']) self.assertNotIn('http_header_x_var3', metadata) def test_metadata_headers_unicode(self): app = swift.Swift(FakeApp(), { 'metadata_headers': 'unicode' }) uni = '\xef\xbd\xa1\xef\xbd\xa5' req = self.get_request('/1.0/account/container', environ={'REQUEST_METHOD': 'GET'}, headers={'UNICODE': uni}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) self._assert_has_api_request(data[2], result=1) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertIsNone(metadata['object']) self.assertEqual('get', data[2]['target']['action']) http_headers = [k for k in metadata.keys() if k.startswith('http_header_')] self.assertEqual(1, len(http_headers)) self.assertEqual(str(uni), metadata['http_header_unicode']) def test_metadata_headers_on_not_existing_header(self): app = swift.Swift(FakeApp(), { 'metadata_headers': 'x-var3' }) req = self.get_request('/1.0/account/container', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) self._assert_has_api_request(data[2], result=1) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertEqual('container', metadata['container']) self.assertIsNone(metadata['object']) self.assertEqual('get', data[2]['target']['action']) http_headers = [k for k in metadata.keys() if k.startswith('http_header_')] self.assertEqual(0, len(http_headers)) def test_policy_idx_from_backend_header(self): # Object requests carry the index on the WSGI env because Swift's # object controller stamps X-Backend-Storage-Policy-Index onto # req.headers before dispatching to the backend. The env header # takes precedence over any value that might arrive on the # response. app = swift.Swift( FakeAppWithHeaders([('X-Backend-Storage-Policy-Index', '9')]), {}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '2'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('2', metadata['policy_idx']) def test_policy_idx_absent_on_account_request(self): # No container in the path means nothing to look up, so the # field is omitted regardless of any env header. app = swift.Swift(FakeApp(), {}) req = self.get_request( '/1.0/account', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '0'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertNotIn('policy_idx', metadata) def test_policy_idx_ignores_unparseable_value(self): app = swift.Swift(FakeApp(), {}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': 'not-an-int'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertNotIn('policy_idx', metadata) def test_policy_idx_from_response_header(self): # Container GET/HEAD/PUT responses carry # X-Backend-Storage-Policy-Index from the container server. That's # the sole source for container-level requests. app = swift.Swift( FakeAppWithHeaders([('X-Backend-Storage-Policy-Index', '3')]), {}) req = self.get_request('/1.0/account/container', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('3', metadata['policy_idx']) def test_policy_idx_ignores_env_header_for_container_requests(self): # Container handlers don't overwrite a client-supplied # X-Backend-Storage-Policy-Index, so it could be spoofed. Ignore # the env header when the request isn't for an object. app = swift.Swift(FakeApp(), {}) req = self.get_request( '/1.0/account/container', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '99'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertNotIn('policy_idx', metadata) def test_policy_idx_empty_env_header_falls_back_to_response(self): # Empty env header is treated as absent; the response header # takes over. app = swift.Swift( FakeAppWithHeaders([('X-Backend-Storage-Policy-Index', '4')]), {}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': ''}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('4', metadata['policy_idx']) def _write_swift_conf(self, path, body): with open(path, 'w') as fp: fp.write(body) def test_policy_name_and_type_emitted_from_swift_conf(self): with tempfile.TemporaryDirectory() as swift_dir: path = os.path.join(swift_dir, 'swift.conf') self._write_swift_conf(path, ( '[storage-policy:0]\n' 'name = Policy-0\n' '[storage-policy:1]\n' 'name = ec42\n' 'policy_type = erasure_coding\n' )) app = swift.Swift(FakeApp(), {'swift_conf_file': path}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '1'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('1', metadata['policy_idx']) self.assertEqual('ec42', metadata['policy_name']) self.assertEqual('erasure_coding', metadata['policy_type']) def test_policy_type_defaults_to_replication(self): # A [storage-policy:N] section without policy_type falls back to # 'replication' the same way swift itself does. with tempfile.TemporaryDirectory() as swift_dir: path = os.path.join(swift_dir, 'swift.conf') self._write_swift_conf(path, ( '[storage-policy:0]\n' 'name = Policy-0\n' )) app = swift.Swift(FakeApp(), {'swift_conf_file': path}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '0'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('Policy-0', metadata['policy_name']) self.assertEqual('replication', metadata['policy_type']) def test_policy_name_and_type_omitted_for_unknown_index(self): # Index emitted but not in the parsed map -> only policy_idx. with tempfile.TemporaryDirectory() as swift_dir: path = os.path.join(swift_dir, 'swift.conf') self._write_swift_conf(path, ( '[storage-policy:0]\n' 'name = Policy-0\n' )) app = swift.Swift(FakeApp(), {'swift_conf_file': path}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '99'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('99', metadata['policy_idx']) self.assertNotIn('policy_name', metadata) self.assertNotIn('policy_type', metadata) def test_policy_synthesized_when_swift_conf_declares_none(self): # File readable but no [storage-policy:N] sections; match # swift's implicit Policy-0 default. with tempfile.TemporaryDirectory() as swift_dir: path = os.path.join(swift_dir, 'swift.conf') self._write_swift_conf(path, ( '[swift-hash]\n' 'swift_hash_path_suffix = anything\n' )) app = swift.Swift(FakeApp(), {'swift_conf_file': path}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '0'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('0', metadata['policy_idx']) self.assertEqual('Policy-0', metadata['policy_name']) self.assertEqual('replication', metadata['policy_type']) def test_policy_name_and_type_omitted_when_swift_conf_missing(self): with tempfile.TemporaryDirectory() as swift_dir: # Intentionally do not write a config file. path = os.path.join(swift_dir, 'swift.conf') app = swift.Swift(FakeApp(), {'swift_conf_file': path}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '0'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('0', metadata['policy_idx']) self.assertNotIn('policy_name', metadata) self.assertNotIn('policy_type', metadata) def test_policy_name_and_type_omitted_when_swift_conf_malformed(self): with tempfile.TemporaryDirectory() as swift_dir: path = os.path.join(swift_dir, 'swift.conf') self._write_swift_conf(path, 'not a valid ini [\n') app = swift.Swift(FakeApp(), {'swift_conf_file': path}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '0'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('0', metadata['policy_idx']) self.assertNotIn('policy_name', metadata) self.assertNotIn('policy_type', metadata) def test_policy_map_skips_malformed_sections(self): # Silently skip sections with non-integer indexes or missing # names; valid siblings still load. Swift itself would reject # such a config, but this guards the middleware's fallback path # against future refactors that might harden the parser. with tempfile.TemporaryDirectory() as swift_dir: path = os.path.join(swift_dir, 'swift.conf') self._write_swift_conf(path, ( '[storage-policy:abc]\n' # non-integer index 'name = bogus\n' '[storage-policy:2]\n' # missing name '[storage-policy:1]\n' # valid 'name = valid-policy\n' )) app = swift.Swift(FakeApp(), {'swift_conf_file': path}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '1'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('1', metadata['policy_idx']) self.assertEqual('valid-policy', metadata['policy_name']) self.assertEqual('replication', metadata['policy_type']) def test_policy_map_from_non_standard_filename(self): # swift_conf_file accepts any path; the filename does not have # to be ``swift.conf``. Accommodates deployments that mount the # config under a different name. with tempfile.TemporaryDirectory() as tmp: path = os.path.join(tmp, 'storage-policies.conf') self._write_swift_conf(path, ( '[storage-policy:0]\n' 'name = replicated\n' )) app = swift.Swift(FakeApp(), {'swift_conf_file': path}) req = self.get_request( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET', 'HTTP_X_BACKEND_STORAGE_POLICY_INDEX': '0'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) metadata = notify.call_args_list[0][0][2]['target']['metadata'] self.assertEqual('0', metadata['policy_idx']) self.assertEqual('replicated', metadata['policy_name']) self.assertEqual('replication', metadata['policy_type']) def test_bogus_path(self): app = swift.Swift(FakeApp(), {}) req = FakeRequest('/5.0//', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(0, len(notify.call_args_list)) def test_missing_resource_id(self): app = swift.Swift(FakeApp(), {}) req = FakeRequest('/v1/', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(0, len(notify.call_args_list)) @mock.patch('urllib.parse.quote') def test_emit_event_fail(self, mocked_func): mocked_func.side_effect = Exception("a exception") app = swift.Swift(FakeApp(body=["test"]), {}) req = self.get_request('/1.0/account/container', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: resp = list(app(req.environ, self.start_response)) self.assertEqual(0, len(notify.call_args_list)) self.assertEqual(["test"], resp) def test_reseller_prefix(self): app = swift.Swift(FakeApp(), {}) req = self.get_request('/1.0/AUTH_account/container/obj', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual("account", data[2]['target']['id']) def test_custom_reseller_prefix(self): app = swift.Swift(FakeApp(), {'reseller_prefix': 'CUSTOM_'}) req = FakeRequest('/1.0/CUSTOM_account/container/obj', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual("account", data[2]['target']['id']) def test_empty_reseller_prefix(self): app = swift.Swift(FakeApp(), {'reseller_prefix': ''}) req = FakeRequest('/1.0/account/container/obj', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual("account", data[2]['target']['id']) def test_incomplete_reseller_prefix(self): # Custom reseller prefix set, but without trailing underscore app = swift.Swift( FakeApp(), {'reseller_prefix': 'CUSTOM'}) req = FakeRequest('/1.0/CUSTOM_account/container/obj', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual("account", data[2]['target']['id']) def test_invalid_reseller_prefix(self): app = swift.Swift( FakeApp(), {'reseller_prefix': 'AUTH_'}) req = FakeRequest('/1.0/admin/bucket', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual("1.0/admin/bucket", data[2]['target']['id']) def test_ignore_requests_from_project(self): app = swift.Swift(FakeApp(), {'ignore_projects': 'skip_proj'}) for proj_attr in ['HTTP_X_SERVICE_PROJECT_ID', 'HTTP_X_PROJECT_ID', 'HTTP_X_TENANT_ID']: for proj, calls in [('good', 1), ('skip_proj', 0)]: req = FakeRequest('/1.0/CUSTOM_account/container/obj', environ={'REQUEST_METHOD': 'GET', proj_attr: proj}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(calls, len(notify.call_args_list)) def test_ignore_requests_from_multiple_projects(self): app = swift.Swift(FakeApp(), {'ignore_projects': 'skip_proj, ignore'}) for proj_attr in ['HTTP_X_SERVICE_PROJECT_ID', 'HTTP_X_PROJECT_ID', 'HTTP_X_TENANT_ID']: for proj, calls in [('good', 1), ('skip_proj', 0), ('also_good', 1), ('ignore', 0)]: req = FakeRequest('/1.0/CUSTOM_account/container/obj', environ={'REQUEST_METHOD': 'GET', proj_attr: proj}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(calls, len(notify.call_args_list)) def test_only_reseller_prefix(self): app = swift.Swift( FakeApp(), {'reseller_prefix': 'CUSTOM'}) req = FakeRequest('/1.0/CUSTOM/container/obj', environ={'REQUEST_METHOD': 'GET'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) data = notify.call_args_list[0][0] self.assertIsNot(0, len(data[2]['target']['id'])) def test_head_account(self): app = swift.Swift(FakeApp(body=['']), {}) req = FakeRequest('/1.0/account', environ={'REQUEST_METHOD': 'HEAD'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertEqual(1, len(notify.call_args_list)) data = notify.call_args_list[0][0] self.assertEqual('objectstore.http.request', data[1]) self._assert_has_api_request(data[2], result=1) self._assert_no_bytes_metrics(data[2]) metadata = data[2]['target']['metadata'] self.assertEqual('1.0', metadata['version']) self.assertIsNone(metadata['container']) self.assertIsNone(metadata['object']) self.assertEqual('head', data[2]['target']['action']) def test_put_with_swift_source(self): app = swift.Swift(FakeApp(), {}) req = FakeRequest( '/1.0/account/container/obj', environ={'REQUEST_METHOD': 'PUT', 'wsgi.input': StringIO('some stuff'), 'swift.source': 'RL'}) with mock.patch('oslo_messaging.Notifier.info') as notify: list(app(req.environ, self.start_response)) self.assertFalse(notify.called) def test_ignore_projects_without_keystone(self): app = swift.Swift(FakeApp(), { 'ignore_projects': 'cf0356aaac7c42bba5a744339a6169fa,' '18157dd635bb413c9e27686fee93c583', }) self.assertEqual(["cf0356aaac7c42bba5a744339a6169fa", "18157dd635bb413c9e27686fee93c583"], app.ignore_projects) @unittest.skip("fixme: needs to add missing mock coverage") @mock.patch.object(swift.LOG, 'warning') def test_ignore_projects_with_keystone(self, warning): self.useFixture(betamax.BetamaxFixture( cassette_name='list_projects', cassette_library_dir='ceilometermiddleware/tests/data', )) app = swift.Swift(FakeApp(), { 'auth_type': 'v2password', 'auth_url': 'https://[::1]:5000/v2.0', 'username': 'admin', 'tenant_name': 'admin', 'password': 'secret', 'ignore_projects': 'service,gnocchi', }) self.assertEqual(["147cc0a9263c4964926f3ee7b6ba3685"], app.ignore_projects) warning.assert_called_once_with( "fail to find project '%s' in keystone", "gnocchi") class TestSwiftS3Api(TestSwift): def get_request(self, path, environ=None, headers=None): environ = environ or {} # Add Swift Path in environ, provided by swift s3api middleware environ['swift.backend_path'] = path # Emulate S3 api PATH_INFO by removing /v1 and account parts path = '/' + path.split('/', 3)[-1] return FakeRequest(path, environ=environ, headers=headers) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3243592 ceilometermiddleware-3.13.0/ceilometermiddleware.egg-info/0000775000175000017500000000000015242063023022463 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1787323923.175359 ceilometermiddleware-3.13.0/ceilometermiddleware.egg-info/PKG-INFO0000644000175000017500000000421115242063023023554 0ustar00zuulzuulMetadata-Version: 2.4 Name: ceilometermiddleware Version: 3.13.0 Summary: OpenStack Telemetry middleware for generating metrics Author-email: OpenStack License-Expression: Apache-2.0 Project-URL: Homepage, https://docs.openstack.org/ceilometermiddleware Project-URL: Repository, https://opendev.org/openstack/ceilometermiddleware Classifier: Environment :: OpenStack Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: System Administrators Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3.14 Requires-Python: >=3.11 Description-Content-Type: text/x-rst License-File: LICENSE Requires-Dist: oslo.config>=3.9.0 Requires-Dist: oslo.messaging>=5.2.0 Requires-Dist: oslo.utils>=4.7.0 Requires-Dist: pbr>=1.6 Requires-Dist: pycadf>=2.0.1 Requires-Dist: keystoneauth1>=2.18.0 Requires-Dist: python-keystoneclient>=3.8.0 Dynamic: license-file Dynamic: requires-dist =============================================== Middleware for OpenStack Telemetry (Ceilometer) =============================================== .. image:: https://governance.openstack.org/tc/badges/ceilometermiddleware.svg This library provides middleware modules designed to enable metric and event data generation to be consumed by Ceilometer. For information on contributing, see ``CONTRIBUTING.rst``. * License: Apache License, Version 2.0 * Documentation: https://docs.openstack.org/ceilometermiddleware/latest/ * Source: http://opendev.org/openstack/ceilometermiddleware * Bugs: http://bugs.launchpad.net/ceilometermiddleware * Release notes: https://docs.openstack.org/releasenotes/ceilometermiddleware/ For any other information, refer to the parent project, Ceilometer: https://opendev.org/openstack/ceilometer ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.2123592 ceilometermiddleware-3.13.0/ceilometermiddleware.egg-info/SOURCES.txt0000664000175000017500000000437615242063023024361 0ustar00zuulzuul.coveragerc .pre-commit-config.yaml .stestr.conf .zuul.yaml AUTHORS CONTRIBUTING.rst ChangeLog HACKING.rst LICENSE README.rst pyproject.toml requirements.txt setup.cfg setup.py test-requirements.txt tox.ini ceilometermiddleware/__init__.py ceilometermiddleware/swift.py ceilometermiddleware.egg-info/PKG-INFO ceilometermiddleware.egg-info/SOURCES.txt ceilometermiddleware.egg-info/dependency_links.txt ceilometermiddleware.egg-info/entry_points.txt ceilometermiddleware.egg-info/not-zip-safe ceilometermiddleware.egg-info/pbr.json ceilometermiddleware.egg-info/requires.txt ceilometermiddleware.egg-info/top_level.txt ceilometermiddleware/tests/__init__.py ceilometermiddleware/tests/base.py ceilometermiddleware/tests/test_swift.py ceilometermiddleware/tests/data/list_projects.yaml doc/requirements.txt doc/source/conf.py doc/source/contributing.rst doc/source/index.rst doc/source/installation.rst doc/source/readme.rst doc/source/usage.rst etc/swift/ceilometer-config-generator.conf releasenotes/notes/.placeholder releasenotes/notes/background-thread-notifier-21b36a5f5c8dec0e.yaml releasenotes/notes/bug-1673738-ec8f7dd8ac43ad54.yaml releasenotes/notes/bug-1679196-ab9d6bb2134120e0.yaml releasenotes/notes/drop-py-2-7-21178ddd27b28806.yaml releasenotes/notes/drop-python-3-6-and-3-7-a7bb45e8a4be299a.yaml releasenotes/notes/emit-storage-policy-index-ff483dd3e914a952.yaml releasenotes/notes/remove-py38-71468a51f4be2bc6.yaml releasenotes/notes/remove-py39-e32a7c27dcc63468.yaml releasenotes/source/2023.1.rst releasenotes/source/2023.2.rst releasenotes/source/2024.1.rst releasenotes/source/2024.2.rst releasenotes/source/2025.1.rst releasenotes/source/2025.2.rst releasenotes/source/2026.1.rst releasenotes/source/conf.py releasenotes/source/index.rst releasenotes/source/mitaka.rst releasenotes/source/newton.rst releasenotes/source/ocata.rst releasenotes/source/pike.rst releasenotes/source/queens.rst releasenotes/source/rocky.rst releasenotes/source/stein.rst releasenotes/source/train.rst releasenotes/source/unreleased.rst releasenotes/source/ussuri.rst releasenotes/source/victoria.rst releasenotes/source/wallaby.rst releasenotes/source/xena.rst releasenotes/source/yoga.rst releasenotes/source/zed.rst releasenotes/source/_static/.placeholder releasenotes/source/_templates/.placeholder././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1787323923.175359 ceilometermiddleware-3.13.0/ceilometermiddleware.egg-info/dependency_links.txt0000664000175000017500000000000115242063023026531 0ustar00zuulzuul ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.1763592 ceilometermiddleware-3.13.0/ceilometermiddleware.egg-info/entry_points.txt0000664000175000017500000000011115242063023025752 0ustar00zuulzuul[paste.filter_factory] swift = ceilometermiddleware.swift:filter_factory ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323922.8283587 ceilometermiddleware-3.13.0/ceilometermiddleware.egg-info/not-zip-safe0000664000175000017500000000000115242063023024711 0ustar00zuulzuul ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.1863592 ceilometermiddleware-3.13.0/ceilometermiddleware.egg-info/pbr.json0000664000175000017500000000005615242063023024142 0ustar00zuulzuul{"git_version": "b35753b", "is_release": true}././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.1763592 ceilometermiddleware-3.13.0/ceilometermiddleware.egg-info/requires.txt0000664000175000017500000000020515242063023025060 0ustar00zuulzuuloslo.config>=3.9.0 oslo.messaging>=5.2.0 oslo.utils>=4.7.0 pbr>=1.6 pycadf>=2.0.1 keystoneauth1>=2.18.0 python-keystoneclient>=3.8.0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.1763592 ceilometermiddleware-3.13.0/ceilometermiddleware.egg-info/top_level.txt0000664000175000017500000000002515242063023025212 0ustar00zuulzuulceilometermiddleware ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3253593 ceilometermiddleware-3.13.0/doc/0000775000175000017500000000000015242063023015350 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3710897 ceilometermiddleware-3.13.0/doc/requirements.txt0000664000175000017500000000012415242062750020637 0ustar00zuulzuulsphinx>=2.1.1 # BSD openstackdocstheme>=2.2.1 # Apache-2.0 reno>=3.1.0 # Apache-2.0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3263593 ceilometermiddleware-3.13.0/doc/source/0000775000175000017500000000000015242063023016650 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3710897 ceilometermiddleware-3.13.0/doc/source/conf.py0000664000175000017500000000511515242062750020157 0ustar00zuulzuul# 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. import os import sys sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx.ext.autodoc', # 'sphinx.ext.intersphinx', 'openstackdocstheme' ] # autodoc generation is a bit aggressive and a nuisance when doing heavy # text edit cycles. # execute "export SPHINX_DEBUG=1" in your terminal to disable # The suffix of source filenames. source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = 'ceilometermiddleware' copyright = '2013, OpenStack Foundation' # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). add_module_names = True # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'native' # -- Options for HTML output -------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. # html_theme_path = ["."] # html_theme = '_theme' # html_static_path = ['static'] html_theme = 'openstackdocs' # Output file base name for HTML help builder. htmlhelp_basename = '%sdoc' % project # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). latex_documents = [ ('index', '%s.tex' % project, '%s Documentation' % project, 'OpenStack Foundation', 'manual'), ] # Example configuration for intersphinx: refer to the Python standard library. # intersphinx_mapping = {'http://docs.python.org/': None} # openstackdocstheme options openstackdocs_repo_name = 'openstack/ceilometermiddleware' openstackdocs_auto_name = False openstackdocs_use_storyboard = True ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3710897 ceilometermiddleware-3.13.0/doc/source/contributing.rst0000664000175000017500000000011315242062750022112 0ustar00zuulzuul============ Contributing ============ .. include:: ../../CONTRIBUTING.rst ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3710897 ceilometermiddleware-3.13.0/doc/source/index.rst0000664000175000017500000000077115242062750020524 0ustar00zuulzuul.. ceilometermiddleware documentation master file, created by sphinx-quickstart on Tue Jul 9 22:26:36 2013. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to ceilometermiddleware's documentation! ======================================================== Contents: .. toctree:: :maxdepth: 2 readme installation usage contributing Indices and tables ================== * :ref:`genindex` * :ref:`search` ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3710897 ceilometermiddleware-3.13.0/doc/source/installation.rst0000664000175000017500000000034515242062750022113 0ustar00zuulzuul============ Installation ============ At the command line:: $ pip install ceilometermiddleware Or, if you have virtualenvwrapper installed:: $ mkvirtualenv ceilometermiddleware $ pip install ceilometermiddleware ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3710897 ceilometermiddleware-3.13.0/doc/source/readme.rst0000664000175000017500000000003615242062750020644 0ustar00zuulzuul.. include:: ../../README.rst ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3710897 ceilometermiddleware-3.13.0/doc/source/usage.rst0000664000175000017500000000014515242062750020514 0ustar00zuulzuul======== Usage ======== To use ceilometermiddleware in a project:: import ceilometermiddleware ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3203592 ceilometermiddleware-3.13.0/etc/0000775000175000017500000000000015242063023015356 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3263593 ceilometermiddleware-3.13.0/etc/swift/0000775000175000017500000000000015242063023016512 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3720896 ceilometermiddleware-3.13.0/etc/swift/ceilometer-config-generator.conf0000664000175000017500000000013515242062750024745 0ustar00zuulzuul[DEFAULT] output_file = etc/swift/ceilometer.conf wrap_width = 79 namespace = oslo.messaging ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3720896 ceilometermiddleware-3.13.0/pyproject.toml0000664000175000017500000000236415242062750017532 0ustar00zuulzuul[build-system] requires = ["pbr>=6.1.1"] build-backend = "pbr.build" [project] name = "ceilometermiddleware" description = "OpenStack Telemetry middleware for generating metrics" readme = "README.rst" authors = [ {name = "OpenStack", email = "openstack-discuss@lists.openstack.org"}, ] requires-python = ">=3.11" license = "Apache-2.0" dynamic = ["version", "dependencies"] classifiers = [ "Environment :: OpenStack", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", ] [project.urls] Homepage = "https://docs.openstack.org/ceilometermiddleware" Repository = "https://opendev.org/openstack/ceilometermiddleware" [project.entry-points."paste.filter_factory"] "swift" = "ceilometermiddleware.swift:filter_factory" [tool.setuptools.packages.find] include = ["ceilometermiddleware*"] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3203592 ceilometermiddleware-3.13.0/releasenotes/0000775000175000017500000000000015242063023017274 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3283594 ceilometermiddleware-3.13.0/releasenotes/notes/0000775000175000017500000000000015242063023020424 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3720896 ceilometermiddleware-3.13.0/releasenotes/notes/.placeholder0000664000175000017500000000000015242062750022703 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3720896 ceilometermiddleware-3.13.0/releasenotes/notes/background-thread-notifier-21b36a5f5c8dec0e.yaml0000664000175000017500000000113315242062750031065 0ustar00zuulzuul--- features: - Introduced option to send notifications from a background thread instead of blocking the service response to send the notification. This option is disabled by default, retaining previous behavior. Enable by setting ``nonblocking_notify`` to ``True`` in the middleware configuration. When enabled notifications will be queued for delivery in a single thread. Set ``send_queue_size`` to customize the length of this delivery queue (default size 1000). - Introduced option to customize the logging level using the ``log_level`` option (default WARNING). ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3720896 ceilometermiddleware-3.13.0/releasenotes/notes/bug-1673738-ec8f7dd8ac43ad54.yaml0000664000175000017500000000045715242062750025404 0ustar00zuulzuul--- fixes: - | The ceilometer middleware now supports loading additional config files to look up oslo.messaging library options. Set the ``extra_config_files`` parameter or the ``extra_config_dirs`` parameter in the ceilometer middleware section in the swift proxy server config file. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3720896 ceilometermiddleware-3.13.0/releasenotes/notes/bug-1679196-ab9d6bb2134120e0.yaml0000664000175000017500000000026215242062750025130 0ustar00zuulzuul--- fixes: - Corrects retrieval of (notification) transport_url for oslo.messaging. Issue would occur when oslo.messaging RPC and Notification backends were separated. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3720896 ceilometermiddleware-3.13.0/releasenotes/notes/drop-py-2-7-21178ddd27b28806.yaml0000664000175000017500000000034615242062750025275 0ustar00zuulzuul--- upgrade: - | Python 2.7 support has been dropped. Last release of ceilometermiddleware to support python 2.7 is OpenStack Train. The minimum version of Python now supported by ceilometermiddleware is Python 3.6. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3720896 ceilometermiddleware-3.13.0/releasenotes/notes/drop-python-3-6-and-3-7-a7bb45e8a4be299a.yaml0000664000175000017500000000020115242062750027521 0ustar00zuulzuul--- upgrade: - | Python 3.6 & 3.7 support has been dropped. The minimum version of Python now supported is Python 3.8. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3730898 ceilometermiddleware-3.13.0/releasenotes/notes/emit-storage-policy-index-ff483dd3e914a952.yaml0000664000175000017500000000367415242062750030561 0ustar00zuulzuul--- features: - | Notification events now include Swift storage policy metadata for the request's container under ``target.metadata.policy_idx``, ``target.metadata.policy_name``, and ``target.metadata.policy_type``. ``policy_idx`` is a canonical decimal string (for example ``"0"``, ``"2"``); ``policy_name`` and ``policy_type`` are read once at startup from ``[storage-policy:N]`` sections in a swift configuration file. A new ``swift_conf_file`` middleware option (default ``/etc/swift/swift.conf``) points at that file and accepts any path or filename, accommodating deployments that do not use the conventional location. The index is read from ``X-Backend-Storage-Policy-Index`` on the request environ for object requests, and from the same header on the response for container GET, HEAD, and PUT requests where the container server includes it. When the configuration file is readable but declares no policies, the middleware mirrors swift's implicit ``Policy-0`` replication default. When the file is missing or unparseable, only ``policy_idx`` is emitted; the middleware logs once at init and continues. ``policy_name`` and ``policy_type`` are always emitted together, or both withheld when the index does not resolve to a known policy. All three fields are omitted for account-level requests, container POST and DELETE (which carry no policy header on the response), pre-controller failures such as invalid-token 401s, and unparseable values. For SLO and COPY the index reflects the container the metered request acted on, not any segment or source containers involved internally; requests routed by path-rewriting middleware (like versioned writes) reflect the rewritten container. This lets billing pipelines distinguish traffic by policy (for example replication versus erasure coding) for usage metering and per-policy request-count reporting. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3730898 ceilometermiddleware-3.13.0/releasenotes/notes/remove-py38-71468a51f4be2bc6.yaml0000664000175000017500000000016615242062750025633 0ustar00zuulzuul--- upgrade: - | Python 3.8 support was dropped. The minimum version of Python now supported is Python 3.9. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3740897 ceilometermiddleware-3.13.0/releasenotes/notes/remove-py39-e32a7c27dcc63468.yaml0000664000175000017500000000016615242062750025640 0ustar00zuulzuul--- upgrade: - | Support for Python 3.9 has been removed. Now Python 3.10 is the minimum version supported. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3313594 ceilometermiddleware-3.13.0/releasenotes/source/0000775000175000017500000000000015242063023020574 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3740897 ceilometermiddleware-3.13.0/releasenotes/source/2023.1.rst0000664000175000017500000000021015242062750022052 0ustar00zuulzuul=========================== 2023.1 Series Release Notes =========================== .. release-notes:: :branch: unmaintained/2023.1 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3740897 ceilometermiddleware-3.13.0/releasenotes/source/2023.2.rst0000664000175000017500000000020215242062750022054 0ustar00zuulzuul=========================== 2023.2 Series Release Notes =========================== .. release-notes:: :branch: stable/2023.2 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3740897 ceilometermiddleware-3.13.0/releasenotes/source/2024.1.rst0000664000175000017500000000021015242062750022053 0ustar00zuulzuul=========================== 2024.1 Series Release Notes =========================== .. release-notes:: :branch: unmaintained/2024.1 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3740897 ceilometermiddleware-3.13.0/releasenotes/source/2024.2.rst0000664000175000017500000000020215242062750022055 0ustar00zuulzuul=========================== 2024.2 Series Release Notes =========================== .. release-notes:: :branch: stable/2024.2 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3740897 ceilometermiddleware-3.13.0/releasenotes/source/2025.1.rst0000664000175000017500000000020215242062750022055 0ustar00zuulzuul=========================== 2025.1 Series Release Notes =========================== .. release-notes:: :branch: stable/2025.1 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3750896 ceilometermiddleware-3.13.0/releasenotes/source/2025.2.rst0000664000175000017500000000020215242062750022056 0ustar00zuulzuul=========================== 2025.2 Series Release Notes =========================== .. release-notes:: :branch: stable/2025.2 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3750896 ceilometermiddleware-3.13.0/releasenotes/source/2026.1.rst0000664000175000017500000000020215242062750022056 0ustar00zuulzuul=========================== 2026.1 Series Release Notes =========================== .. release-notes:: :branch: stable/2026.1 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3313594 ceilometermiddleware-3.13.0/releasenotes/source/_static/0000775000175000017500000000000015242063023022222 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3750896 ceilometermiddleware-3.13.0/releasenotes/source/_static/.placeholder0000664000175000017500000000000015242062750024501 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3313594 ceilometermiddleware-3.13.0/releasenotes/source/_templates/0000775000175000017500000000000015242063023022731 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3750896 ceilometermiddleware-3.13.0/releasenotes/source/_templates/.placeholder0000664000175000017500000000000015242062750025210 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3760898 ceilometermiddleware-3.13.0/releasenotes/source/conf.py0000664000175000017500000002124015242062750022100 0ustar00zuulzuul#!/usr/bin/env python3 # 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. # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'openstackdocstheme', 'reno.sphinxext', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. author = 'Ceilometer Middleware Contributors' category = 'Miscellaneous' copyright = '2016, Ceilometer Middleware Developers' project = 'Ceilometer Middleware Release Notes' description = 'Ceilometer Middleware publishes traffic measures for Swift.' title = 'Ceilometer Middleware Release Notes' target_name = 'ceilometermiddleware' # Release notes do not need a version number in the title, they # cover multiple releases. # The full version, including alpha/beta/rc tags. release = '' # The short X.Y version. version = '' # openstackdocstheme options openstackdocs_repo_name = 'openstack/ceilometermiddleware' openstackdocs_use_storyboard = True openstackdocs_auto_name = False # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all # documents. # default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. # add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). # add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. # show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'native' # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. # keep_warnings = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'openstackdocs' # 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 # documentation. # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None # A shorter title for the navigation bar. Default is the same as html_title. # html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. # html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. # html_extra_path = [] # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. # html_additional_pages = {} # If false, no module index is generated. # html_domain_indices = True # If false, no index is generated. # html_use_index = True # If true, the index is split into individual pages for each letter. # html_split_index = False # If true, links to the reST sources are added to the pages. # html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. # html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). # html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = target_name + '-docs' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, target_name + '.tex', title, author, 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. # latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. # latex_use_parts = False # If true, show page references after internal links. # latex_show_pagerefs = False # If true, show URL addresses after external links. # latex_show_urls = False # Documents to append as an appendix to all manuals. # latex_appendices = [] # If false, no module index is generated. # latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, target_name, title, [author], 1), ] # If true, show URL addresses after external links. # man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, target_name, title, author, project, description, category), ] # Documents to append as an appendix to all manuals. # texinfo_appendices = [] # If false, no module index is generated. # texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. # texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. # texinfo_no_detailmenu = False # -- Options for Internationalization output ------------------------------ locale_dirs = ['locale/'] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3760898 ceilometermiddleware-3.13.0/releasenotes/source/index.rst0000664000175000017500000000054415242062750022446 0ustar00zuulzuul==================================== Ceilometer Middleware Release Notes ==================================== .. toctree:: :maxdepth: 1 unreleased 2026.1 2025.2 2025.1 2024.2 2024.1 2023.2 2023.1 zed yoga xena wallaby victoria ussuri train stein rocky queens pike ocata newton mitaka ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3760898 ceilometermiddleware-3.13.0/releasenotes/source/mitaka.rst0000664000175000017500000000022215242062750022576 0ustar00zuulzuul============================== Mikata Series Release Notes ============================== .. release-notes:: :branch: origin/stable/mitaka ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3760898 ceilometermiddleware-3.13.0/releasenotes/source/newton.rst0000664000175000017500000000022215242062750022642 0ustar00zuulzuul============================== Newton Series Release Notes ============================== .. release-notes:: :branch: origin/stable/newton ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3760898 ceilometermiddleware-3.13.0/releasenotes/source/ocata.rst0000664000175000017500000000023015242062750022416 0ustar00zuulzuul=================================== Ocata Series Release Notes =================================== .. release-notes:: :branch: origin/stable/ocata ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3760898 ceilometermiddleware-3.13.0/releasenotes/source/pike.rst0000664000175000017500000000021715242062750022264 0ustar00zuulzuul=================================== Pike Series Release Notes =================================== .. release-notes:: :branch: stable/pike ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3760898 ceilometermiddleware-3.13.0/releasenotes/source/queens.rst0000664000175000017500000000022315242062750022631 0ustar00zuulzuul=================================== Queens Series Release Notes =================================== .. release-notes:: :branch: stable/queens ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3760898 ceilometermiddleware-3.13.0/releasenotes/source/rocky.rst0000664000175000017500000000022115242062750022456 0ustar00zuulzuul=================================== Rocky Series Release Notes =================================== .. release-notes:: :branch: stable/rocky ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3760898 ceilometermiddleware-3.13.0/releasenotes/source/stein.rst0000664000175000017500000000022115242062750022451 0ustar00zuulzuul=================================== Stein Series Release Notes =================================== .. release-notes:: :branch: stable/stein ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3770897 ceilometermiddleware-3.13.0/releasenotes/source/train.rst0000664000175000017500000000017615242062750022455 0ustar00zuulzuul========================== Train Series Release Notes ========================== .. release-notes:: :branch: stable/train ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3770897 ceilometermiddleware-3.13.0/releasenotes/source/unreleased.rst0000664000175000017500000000016015242062750023460 0ustar00zuulzuul============================== Current Series Release Notes ============================== .. release-notes:: ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3770897 ceilometermiddleware-3.13.0/releasenotes/source/ussuri.rst0000664000175000017500000000020215242062750022660 0ustar00zuulzuul=========================== Ussuri Series Release Notes =========================== .. release-notes:: :branch: stable/ussuri ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3770897 ceilometermiddleware-3.13.0/releasenotes/source/victoria.rst0000664000175000017500000000022015242062750023146 0ustar00zuulzuul============================= Victoria Series Release Notes ============================= .. release-notes:: :branch: unmaintained/victoria ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3770897 ceilometermiddleware-3.13.0/releasenotes/source/wallaby.rst0000664000175000017500000000021415242062750022764 0ustar00zuulzuul============================ Wallaby Series Release Notes ============================ .. release-notes:: :branch: unmaintained/wallaby ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3770897 ceilometermiddleware-3.13.0/releasenotes/source/xena.rst0000664000175000017500000000020015242062750022257 0ustar00zuulzuul========================= Xena Series Release Notes ========================= .. release-notes:: :branch: unmaintained/xena ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3770897 ceilometermiddleware-3.13.0/releasenotes/source/yoga.rst0000664000175000017500000000020015242062750022263 0ustar00zuulzuul========================= Yoga Series Release Notes ========================= .. release-notes:: :branch: unmaintained/yoga ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3770897 ceilometermiddleware-3.13.0/releasenotes/source/zed.rst0000664000175000017500000000017415242062750022120 0ustar00zuulzuul======================== Zed Series Release Notes ======================== .. release-notes:: :branch: unmaintained/zed ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323880.3770897 ceilometermiddleware-3.13.0/requirements.txt0000664000175000017500000000070515242062750020077 0ustar00zuulzuul# Requirements lower bounds listed here are our best effort to keep them up to # date but we do not test them so no guarantee of having them all correct. If # you find any incorrect lower bounds, let us know or propose a fix. oslo.config>=3.9.0 # Apache-2.0 oslo.messaging>=5.2.0 # Apache-2.0 oslo.utils>=4.7.0 # Apache-2.0 pbr>=1.6 # Apache-2.0 pycadf>=2.0.1 # Apache-2.0 keystoneauth1>=2.18.0 # Apache-2.0 python-keystoneclient>=3.8.0 # Apache-2.0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1787323923.3323593 ceilometermiddleware-3.13.0/setup.cfg0000664000175000017500000000011615242063023016422 0ustar00zuulzuul[metadata] name = ceilometermiddleware [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000003200000000000010210 xustar0026 mtime=1787323880.37809 ceilometermiddleware-3.13.0/setup.py0000664000175000017500000000122115242062750016317 0ustar00zuulzuul# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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. import setuptools setuptools.setup(pbr=True) ././@PaxHeader0000000000000000000000000000003200000000000010210 xustar0026 mtime=1787323880.37809 ceilometermiddleware-3.13.0/test-requirements.txt0000664000175000017500000000012515242062750021050 0ustar00zuulzuuloslotest>=1.10.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0 betamax>=0.7.0 # Apache-2.0 ././@PaxHeader0000000000000000000000000000003200000000000010210 xustar0026 mtime=1787323880.37809 ceilometermiddleware-3.13.0/tox.ini0000664000175000017500000000322215242062750016123 0ustar00zuulzuul[tox] minversion = 4.28.0 envlist = py3,pep8,releasenotes skipsdist = True [testenv] usedevelop = True constraints = {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} [testenv:pep8] skip_install = true deps = pre-commit commands = pre-commit run -a [testenv:venv] commands = {posargs} [testenv:cover] deps = {[testenv]deps} coverage>=3.6 # Apache-2.0 setenv = PYTHON=coverage run --source $project --parallel-mode commands = coverage erase stestr run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml coverage report [testenv:docs] deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html [testenv:debug] commands = oslo_debug_helper {posargs} [testenv:releasenotes] skip_install = true deps = {[testenv:docs]deps} commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [flake8] show-source = True # W503 line break before binary operator ignore = W503 # [H106] Do not put vim configuration in source files. # [H203] Use assertIs(Not)None to check for None. # [H204] Use assert(Not)Equal to check for equality. # [H205] Use assert(Greater|Less)(Equal) for comparison. # [H904] Delay string interpolations at logging calls. enable-extensions=H106,H203,H204,H205,H904 exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build [testenv:genconfig] commands = oslo-config-generator --config-file=etc/swift/ceilometer-config-generator.conf