From a540907f327b4b74ccc7e94e4361903977e20d9a Mon Sep 17 00:00:00 2001 From: Adam Reznechek Date: Wed, 22 Oct 2014 14:45:01 -0500 Subject: [PATCH] Initial Load of Ceilometer PowerVM Project Initial work to enable the Ceilometer PowerVM project in git. The work done here provides: - .gitignore - Indicate which files not to track within Git. - .gitreview - Input to the git-review command on how to send to Gerrit. - .testr.conf - Conf file input for the testr command (UT) - CONTRIBUTING.rst - Information on how to contribute. - HACKING.rst - Information on what needs to be done for updates. - LICENSE - The license for the project - README.rst - Information on what this project is. Currently this is the blueprint. - openstack-common.conf - Required openstack configuration for all projects - setup.cfg - Input to the setup.py on how to execute certain actions. - setup.py - Used for build of the project. - requirements.txt - Required packages (and levels) to run the code. - test-requirements.txt - Required packages (and levels) in addition to the requirements, that indicates what is needed to run the UT. - tox.ini - The input for the tox commands. In addition, a base set of packages for the agent and unit tests were loaded in. Change-Id: I49f23751b8694f6e3595fe8b4f39822737e68f31 --- .gitignore | 5 + .gitreview | 4 + .testr.conf | 7 + CONTRIBUTING.rst | 17 ++ HACKING.rst | 21 ++ LICENSE | 176 ++++++++++++++ README.rst | 224 ++++++++++++++++++ ceilometer_powervm/__init__.py | 14 ++ ceilometer_powervm/compute/__init__.py | 0 ceilometer_powervm/compute/virt/__init__.py | 0 .../compute/virt/powervm/__init__.py | 16 ++ .../compute/virt/powervm/inspector.py | 17 ++ ceilometer_powervm/tests/__init__.py | 0 ceilometer_powervm/tests/compute/__init__.py | 0 .../tests/compute/virt/__init__.py | 0 .../tests/compute/virt/powervm/__init__.py | 16 ++ openstack-common.conf | 4 + requirements.txt | 6 + setup.cfg | 43 ++++ setup.py | 22 ++ test-requirements.txt | 12 + tox.ini | 36 +++ 22 files changed, 640 insertions(+) create mode 100644 .gitignore create mode 100644 .gitreview create mode 100644 .testr.conf create mode 100644 CONTRIBUTING.rst create mode 100644 HACKING.rst create mode 100644 LICENSE create mode 100644 README.rst create mode 100644 ceilometer_powervm/__init__.py create mode 100644 ceilometer_powervm/compute/__init__.py create mode 100644 ceilometer_powervm/compute/virt/__init__.py create mode 100644 ceilometer_powervm/compute/virt/powervm/__init__.py create mode 100644 ceilometer_powervm/compute/virt/powervm/inspector.py create mode 100644 ceilometer_powervm/tests/__init__.py create mode 100644 ceilometer_powervm/tests/compute/__init__.py create mode 100644 ceilometer_powervm/tests/compute/virt/__init__.py create mode 100644 ceilometer_powervm/tests/compute/virt/powervm/__init__.py create mode 100644 openstack-common.conf create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a9ce3fc --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/build/ +.testrepository +.tox/ +ceilometer_powervm.egg-info/ +*.pyc diff --git a/.gitreview b/.gitreview new file mode 100644 index 0000000..4f0e21f --- /dev/null +++ b/.gitreview @@ -0,0 +1,4 @@ +[gerrit] +host=***REMOVED*** +port=29418 +project=ceilometer-powervm.git diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 0000000..3199fbb --- /dev/null +++ b/.testr.conf @@ -0,0 +1,7 @@ +[DEFAULT] +test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ + OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ + OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-600} \ + ${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 0000000..10cdecd --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,17 @@ +If you would like to contribute to the development of OpenStack, +you must follow the steps in the "If you're a developer, start here" +section of this page: + + http://wiki.openstack.org/HowToContribute + +Once those steps have been completed, changes to OpenStack +should be submitted for review via the Gerrit tool, following +the workflow documented at: + + http://wiki.openstack.org/GerritWorkflow + +Pull requests submitted through GitHub will be ignored. + +Bugs should be filed on Launchpad, not GitHub: + + https://bugs.launchpad.net/ceilometer-powervm diff --git a/HACKING.rst b/HACKING.rst new file mode 100644 index 0000000..c504fe1 --- /dev/null +++ b/HACKING.rst @@ -0,0 +1,21 @@ +Ceilometer-PowerVM Style Commandments +================================== + +- Step 1: Read the OpenStack Style Commandments + http://docs.openstack.org/developer/hacking/ +- Step 2: Read on + +Creating Unit Tests +------------------- +For every new feature, unit tests should be created that both test and +(implicitly) document the usage of said feature. If submitting a patch for a +bug that had no unit test, a new passing unit test should be added. If a +submitted bug fix does have a unit test, be sure to add a new one that fails +without the patch and passes with the patch. + +All unittest classes must ultimately inherit from testtools.TestCase. + +All setUp and tearDown methods must upcall using the super() method. +tearDown methods should be avoided and addCleanup calls should be preferred. +Never manually create tempfiles. Always use the tempfile fixtures from +the fixture library to ensure that they are cleaned up. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..68c771a --- /dev/null +++ b/LICENSE @@ -0,0 +1,176 @@ + + 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. + diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..53031b9 --- /dev/null +++ b/README.rst @@ -0,0 +1,224 @@ +========================================================= +Support for PowerVM Performance Monitoring +========================================================= + +Include the URL of your launchpad blueprint: + +https://blueprints.launchpad.net/ceilometer/+spec/example +https://blueprints.launchpad.net/python-ceilometerclient/+spec/example + +The IBM PowerVM hypervisor provides virtualization on POWER hardware. +PowerVM customers can see benefits in their environments by making use +of OpenStack. This blueprint outlines implementing Ceilometer-compatible +compute agent plugins. These, along with a Nova driver and Neutron agent +defined in other blueprints, will provide capability for PowerVM +customers to natively monitor utilization and statistics for instances +running on OpenStack managed systems. + +Problem description +=================== + +PowerVM supports a variety of Performance Monitoring interfaces within +the platform, providing virtual machine and system monitoring data. +Today, however, Ceilometer does not collect metrics for virtual machines +running on the PowerVM platform. With the proposal of a PowerVM Nova +driver it is necessary to extend support for PowerVM into Ceilometer as +well. + +This blueprint will outlines implementing Ceilometer-compatible compute +agent plugins for the PowerVM hypervisor. With this update the +Ceilometer compute agent will run on each PowerVM compute node and will +poll against the PowerVM REST API to retrieve data on running instances. + +Proposed change +=============== + +This blueprint, along with associated blueprints in Nova and Neutron, +plans to bring the PowerVM hypervisor into the OpenStack community. + +The Ceilometer compute agent provides a framework that allows +hypervisors to integrate support for gathering instance statistics and +utilization details into Ceilometer. The proposed change plans to build +upon the work that the Ceilometer community has done within the compute +agent by adding support for gathering instance data from the PowerVM +Performance Monitoring infrastructure. + +A new compute agent inspector will be added for PowerVM. This will +follow the existing inspector specification and poll PowerVM Performance +Monitoring to retrieve instance monitoring data. Data on instance cpu, +network, memory, and disk usage will be returned by the inspector when +called by the associated pollster. Interactions with PowerVM Performance +Monitoring will occur using the PowerVM REST API stack via an open +source python wrapper to be defined. + +These changes are planned to be developed in StackForge under a powervm +project. A separate blueprint will be proposed for the ā€˜Lā€™ release of +OpenStack to promote it to the Ceilometer project. This will allow for a +longer period of time to show functional testing and drive maturity. + +Until the promotion to the core Ceilometer project is complete, these +changes will be marked experimental. + +Alternatives +------------ + +Alternatives include writing a PowerVM-specific compute agent or +separate PowerVM-specific compute agent plugins. These solutions do not +follow the existing Ceilometer standard for hypervisor instance +monitoring, would not fit within broader project goals, and would end up +re-implementing logic. + +Data model impact +----------------- + +None + +REST API impact +--------------- + +None + +Security impact +--------------- + +None + +Pipeline impact +--------------- + +This change extends the existing Ceilometer compute agent and should +have no Pipeline impact. + +Other end user impact +--------------------- + +None to the deployer. + +For the Kilo release of OpenStack, the administrator will need to obtain +the change from StackForge (and understand its experimental status). + +Performance/Scalability Impacts +------------------------------- + +This change should have no impacts to performance or scalability of the +system. The amount of data being gathered and processed will be similar +to that of the existing libvirt, vmware, and hyper-v inspectors. + +Other deployer impact +--------------------- + +The cloud administrator will need to refer to documentation on how to +configure OpenStack for use with a PowerVM hypervisor. + +Assuming the PowerVM REST API and Python wrapper library are available, +no additional configuration should be required. + +Developer impact +---------------- + +None + +Implementation +============== + +Assignee(s) +----------- + +Primary assignee: adreznec + +Other contributors: thorst kyleh dwarcher + +Ongoing maintainer: adreznec + +Work Items +---------- + +- Create a PowerVM-specific inspector in the + /ceilometer/compute/virt/powervm folder. Stub out the methods. + +- Create a PowerVM helper utility for interfacing with the PowerVM REST + API python wrapper. + +- Implement inspector calls to match the virt inspector abstraction, + making calls against the PowerVM REST API to collect cpu, vnic, disk, + and memory statistics. + +- Provide extensive unit tests (part of other work items). + +- Implement a functional automation server that listens for incoming + change set commits from the community and provides a non-gating vote + (+1 or -1) on the change. + +Future lifecycle +================ + +Ongoing maintenance of the PowerVM compute agent inspector will be +handled by the IBM OpenStack team over the course of the next two +release cycles. In the Kilo timeframe this change will remain in +StackForge, with a target of merging in the ā€˜Lā€™ timeframe and continued +maintenance and updates as the Ceilometer architecture requires. + +Dependencies +============ + +- The Ceilometer compute agent. + +- Will utilize the PowerVM REST API specification for management. Will + utilize future versions of this specification as it becomes + available: http://ibm.co/1lThV9R + +- Will build on top of a new open source python binding to previously + noted PowerVM REST API. This will be a prerequisite to utilizing the + driver. + +Testing +======= + +Tempest Tests +------------- + +Since the tempest tests should be implementation-agnostic, the existing +tempest tests should be able to run against the PowerVM polling code +without issue. This blueprint does not foresee any changes based off +this work. + +Thorough unit tests will be created with the agent to validate specific +functions within this implementation. + +Functional Tests +---------------- + +A third party functional test environment will be created. It will +monitor for incoming neutron change sets. Once it detects a new change +set, it will utilize the existing lifecycle API tests. A non-gating vote +(+1 or -1) will be provided with information (logs) based on the result. + +API Tests +--------- + +The REST APIs are not planned to change as part of this. Existing APIs +should be valid. All testing is planned within the functional testing +system and via unit tests. + +Documentation Impact +==================== + +No documentation additions are anticipated. If the existing developer +documentation is updated to reflect more hypervisor-specific items, this +agent will follow suit. + +References +========== + +- Ceilometer Architecture: + http://docs.openstack.org/developer/ceilometer/architecture.html + +- PowerVM REST API Initial Specification (may require a newer version + as they become available): http://ibm.co/1lThV9R + +- PowerVM Virtualization Introduction and Configuration: + http://www.redbooks.ibm.com/abstracts/sg247940.html?Open + +- PowerVM Best Practices: + http://www.redbooks.ibm.com/abstracts/sg248062.html?Open + diff --git a/ceilometer_powervm/__init__.py b/ceilometer_powervm/__init__.py new file mode 100644 index 0000000..31285c4 --- /dev/null +++ b/ceilometer_powervm/__init__.py @@ -0,0 +1,14 @@ +# Copyright 2011 OpenStack Foundation +# All Rights Reserved. +# +# 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. diff --git a/ceilometer_powervm/compute/__init__.py b/ceilometer_powervm/compute/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ceilometer_powervm/compute/virt/__init__.py b/ceilometer_powervm/compute/virt/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ceilometer_powervm/compute/virt/powervm/__init__.py b/ceilometer_powervm/compute/virt/powervm/__init__.py new file mode 100644 index 0000000..a4215e2 --- /dev/null +++ b/ceilometer_powervm/compute/virt/powervm/__init__.py @@ -0,0 +1,16 @@ +# Copyright 2014 IBM Corp. +# +# All Rights Reserved. +# +# 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. + diff --git a/ceilometer_powervm/compute/virt/powervm/inspector.py b/ceilometer_powervm/compute/virt/powervm/inspector.py new file mode 100644 index 0000000..8b57f36 --- /dev/null +++ b/ceilometer_powervm/compute/virt/powervm/inspector.py @@ -0,0 +1,17 @@ +# Copyright 2014 IBM Corp. +# +# All Rights Reserved. +# +# 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. +# +# @author: Adam Reznechek, IBM Corp. diff --git a/ceilometer_powervm/tests/__init__.py b/ceilometer_powervm/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ceilometer_powervm/tests/compute/__init__.py b/ceilometer_powervm/tests/compute/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ceilometer_powervm/tests/compute/virt/__init__.py b/ceilometer_powervm/tests/compute/virt/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ceilometer_powervm/tests/compute/virt/powervm/__init__.py b/ceilometer_powervm/tests/compute/virt/powervm/__init__.py new file mode 100644 index 0000000..a4215e2 --- /dev/null +++ b/ceilometer_powervm/tests/compute/virt/powervm/__init__.py @@ -0,0 +1,16 @@ +# Copyright 2014 IBM Corp. +# +# All Rights Reserved. +# +# 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. + diff --git a/openstack-common.conf b/openstack-common.conf new file mode 100644 index 0000000..dd5a808 --- /dev/null +++ b/openstack-common.conf @@ -0,0 +1,4 @@ +[DEFAULT] + +# The base module to hold the copy of openstack.common +base=ceilometer_powervm diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..823c2b4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +oslosphinx +pbr>=0.6,!=0.7,<1.0 +sphinx>=1.1.2,<1.2 +testrepository>=0.0.18 +testtools>=0.9.34 +yasfb>=0.5.1 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..f017ab8 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,43 @@ +[metadata] +name = ceilometer_powervm +summary = PowerVM Ceilometer Inspector for OpenStack Ceilometer. +description-file = README.rst +author = IBM +author-email = adreznec@us.ibm.com +home-page = ??? +classifier = + Environment :: OpenStack + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.3 + +[files] +packages = ceilometer_powervm + +[build_sphinx] +all_files = 1 +source-dir = doc/source +build-dir = doc/build + +[upload_sphinx] +upload-dir = doc/build/html + +[compile_catalog] +directory = ceilometer_powervm/locale +domain = ceilometer_powervm + +[update_catalog] +domain = ceilometer_powervm +output_dir = ceilometer_powervm/locale +input_file = ceilometer_powervm/locale/ceilometer_powervm.pot + +[extract_messages] +keywords = _ gettext ngettext l_ lazy_gettext +mapping_file = babel.cfg +output_file = ceilometer_powervm/locale/ceilometer_powervm.pot diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..fc4f41f --- /dev/null +++ b/setup.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# Copyright 2014 IBM Corp. +# +# 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 MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT +import setuptools + +setuptools.setup( + setup_requires=['pbr'], + pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..e1415b3 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,12 @@ +hacking>=0.9.2,<0.10 + +coverage>=3.6 +discover +fixtures>=0.3.14 +python-subunit>=0.0.18 +testrepository>=0.0.18 +testscenarios>=0.4,<0.5 +testtools>=0.9.34 +oslotest +mock>=1.0 +mox>=0.5.3 diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..23bc696 --- /dev/null +++ b/tox.ini @@ -0,0 +1,36 @@ +[tox] +minversion = 1.6 +skipsdist = True +envlist = py27,py33,pep8 + +[testenv] +usedevelop = True +install_command = pip install -U {opts} {packages} +setenv = VIRTUAL_ENV={envdir} + PYTHONHASHSEED=0 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + -egit+https://github.com/openstack/ceilometer#egg=ceilometer +commands = python -m ceilometer.openstack.common.lockutils python setup.py testr --slowest --testr-args="{posargs}" +downloadcache = {toxworkdir}/_download + +[testenv:pep8] +commands = flake8 + +[testenv:venv] +commands = {posargs} + +[testenv:cover] +commands = python -m ceilometer.openstack.common.lockutils python setup.py testr --slowest --coverage --testr-args="{posargs}" + +[testenv:docs] +commands = python setup.py build_sphinx + +[flake8] +ignore = H305 +builtins = _ +exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools,nova_tests,build +show-source = true + +[hacking] +import_exceptions = ceilometer.openstack.common.gettextutils