diff --git a/.gitignore b/.gitignore index d77f63a..fb88773 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /python-heatclient-0.2.4.tar.gz /python-heatclient-0.2.5.tar.gz /python-heatclient-0.2.6.tar.gz +/python-heatclient-0.2.9.tar.gz diff --git a/0001-Nuke-pbr-requirements-handling.patch b/0001-Nuke-pbr-requirements-handling.patch index 3090645..ea00457 100644 --- a/0001-Nuke-pbr-requirements-handling.patch +++ b/0001-Nuke-pbr-requirements-handling.patch @@ -1,30 +1,12 @@ -From 227e0bacc76c92e0755a13773a81ccd3853f0765 Mon Sep 17 00:00:00 2001 +From 51926c18818da2ac832ca2b38e4864a169435bc4 Mon Sep 17 00:00:00 2001 From: Jakub Ruzicka Date: Mon, 16 Sep 2013 17:25:48 +0200 Subject: [PATCH] Nuke pbr requirements handling --- - requirements.txt | 8 -------- - setup.py | 1 - - test-requirements.txt | 15 --------------- - 3 files changed, 24 deletions(-) - delete mode 100644 requirements.txt - delete mode 100644 test-requirements.txt + setup.py | 1 - + 1 file changed, 1 deletion(-) -diff --git a/requirements.txt b/requirements.txt -deleted file mode 100644 -index 6947270..0000000 ---- a/requirements.txt -+++ /dev/null -@@ -1,8 +0,0 @@ --pbr>=0.5.21,<1.0 --argparse --httplib2 --iso8601>=0.1.8 --PrettyTable>=0.6,<0.8 --python-keystoneclient>=0.4.1 --PyYAML>=3.1.0 --six>=1.4.1 diff --git a/setup.py b/setup.py index 70c2b3f..afab729 100755 --- a/setup.py @@ -35,24 +17,3 @@ index 70c2b3f..afab729 100755 setuptools.setup( - setup_requires=['pbr'], pbr=True) -diff --git a/test-requirements.txt b/test-requirements.txt -deleted file mode 100644 -index 121780d..0000000 ---- a/test-requirements.txt -+++ /dev/null -@@ -1,15 +0,0 @@ --# Install bounded pep8/pyflakes first, then let flake8 install --pep8==1.4.5 --pyflakes>=0.7.2,<0.7.4 --flake8==2.0 --hacking>=0.8.0,<0.9 --coverage>=3.6 --discover --fixtures>=0.3.14 --mock>=1.0 --mox>=0.5.3 --mox3>=0.7.0 --sphinx>=1.1.2 --testscenarios>=0.4 --testrepository>=0.0.17 --testtools>=0.9.32 diff --git a/0002-Remove-runtime-dependency-on-python-pbr.patch b/0002-Remove-runtime-dependency-on-python-pbr.patch index f3ff03f..27d026f 100644 --- a/0002-Remove-runtime-dependency-on-python-pbr.patch +++ b/0002-Remove-runtime-dependency-on-python-pbr.patch @@ -1,4 +1,4 @@ -From f2aba1fdc34599428b4c498c8b9968dfc7317c0b Mon Sep 17 00:00:00 2001 +From 594fe7d99a3221e387ca8c74887bb3d49fa88b8e Mon Sep 17 00:00:00 2001 From: Jakub Ruzicka Date: Mon, 9 Dec 2013 15:58:31 +0100 Subject: [PATCH] Remove runtime dependency on python-pbr diff --git a/0003-Add-support-for-resource_types.patch b/0003-Add-support-for-resource_types.patch deleted file mode 100644 index 03ae14b..0000000 --- a/0003-Add-support-for-resource_types.patch +++ /dev/null @@ -1,187 +0,0 @@ -From 66bdba1971ef0ca48d2f8c5da63d34baf8a2fdb5 Mon Sep 17 00:00:00 2001 -From: Angus Salkeld -Date: Thu, 12 Dec 2013 13:18:11 +1100 -Subject: [PATCH] Add support for resource_types - -This adds the following commands: -$ heat resource-type-list -$ heat resource-type-show - -Change-Id: Ifa70da5bc56a5f2979697a9ce2c41fa9a5c1f947 -Closes-bug: #1260130 -(cherry picked from commit b14697ea3fada6e9f6725fa14e9c669beebd8875) - -Conflicts: - heatclient/v1/client.py ---- - heatclient/tests/test_resource_types.py | 45 +++++++++++++++++++++++++++++++ - heatclient/v1/client.py | 13 +++++---- - heatclient/v1/resource_types.py | 47 +++++++++++++++++++++++++++++++++ - heatclient/v1/shell.py | 20 ++++++++++++++ - 4 files changed, 120 insertions(+), 5 deletions(-) - create mode 100644 heatclient/tests/test_resource_types.py - create mode 100644 heatclient/v1/resource_types.py - -diff --git a/heatclient/tests/test_resource_types.py b/heatclient/tests/test_resource_types.py -new file mode 100644 -index 0000000..4030fd8 ---- /dev/null -+++ b/heatclient/tests/test_resource_types.py -@@ -0,0 +1,45 @@ -+# -+# 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 mock -+import testtools -+ -+from heatclient.v1.resource_types import ResourceTypeManager -+ -+ -+class ResourceTypeManagerTest(testtools.TestCase): -+ -+ def test_list_types(self): -+ manager = ResourceTypeManager(None) -+ manager._list = mock.MagicMock() -+ manager.list() -+ manager._list.assert_called_once_with('/resource_types', -+ 'resource_types') -+ -+ def test_get(self): -+ resource_type = u'OS::Nova::KeyPair' -+ -+ class FakeAPI(object): -+ """Fake API and ensure request url is correct.""" -+ def __init__(self, *args, **kwargs): -+ self.requests = [] -+ -+ def json_request(self, *args, **kwargs): -+ self.requests.append(args) -+ return {}, {'attributes': [], 'properties': []} -+ -+ test_api = FakeAPI() -+ manager = ResourceTypeManager(test_api) -+ manager.get(resource_type) -+ expect = ('GET', '/resource_types/OS%3A%3ANova%3A%3AKeyPair') -+ self.assertIn(expect, test_api.requests) -diff --git a/heatclient/v1/client.py b/heatclient/v1/client.py -index 3ec6be6..940a94a 100644 ---- a/heatclient/v1/client.py -+++ b/heatclient/v1/client.py -@@ -16,6 +16,7 @@ - from heatclient.common import http - from heatclient.v1 import actions - from heatclient.v1 import events -+from heatclient.v1 import resource_types - from heatclient.v1 import resources - from heatclient.v1 import stacks - -@@ -32,8 +33,10 @@ class Client(http.HTTPClient): - - def __init__(self, *args, **kwargs): - """Initialize a new client for the Heat v1 API.""" -- super(Client, self).__init__(*args, **kwargs) -- self.stacks = stacks.StackManager(self) -- self.resources = resources.ResourceManager(self) -- self.events = events.EventManager(self) -- self.actions = actions.ActionManager(self) -+ self.http_client = http.HTTPClient(*args, **kwargs) -+ self.stacks = stacks.StackManager(self.http_client) -+ self.resources = resources.ResourceManager(self.http_client) -+ self.resource_types = resource_types.ResourceTypeManager( -+ self.http_client) -+ self.events = events.EventManager(self.http_client) -+ self.actions = actions.ActionManager(self.http_client) -diff --git a/heatclient/v1/resource_types.py b/heatclient/v1/resource_types.py -new file mode 100644 -index 0000000..2600197 ---- /dev/null -+++ b/heatclient/v1/resource_types.py -@@ -0,0 +1,47 @@ -+# -+# 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 heatclient.common import base -+from heatclient.openstack.common.py3kcompat import urlutils -+from heatclient.openstack.common import strutils -+ -+ -+class ResourceType(base.Resource): -+ def __repr__(self): -+ return "" % self._info -+ -+ def data(self, **kwargs): -+ return self.manager.data(self, **kwargs) -+ -+ def _add_details(self, info): -+ self.resource_type = info -+ -+ -+class ResourceTypeManager(base.Manager): -+ resource_class = ResourceType -+ -+ def list(self): -+ """Get a list of resource types. -+ :rtype: list of :class:`ResourceType` -+ """ -+ return self._list('/resource_types', 'resource_types') -+ -+ def get(self, resource_type): -+ """Get the details for a specific resource_type. -+ -+ :param resource_type: name of the resource type to get the details for -+ """ -+ url_str = '/resource_types/%s' % ( -+ urlutils.quote(strutils.safe_encode(resource_type), '')) -+ resp, body = self.api.json_request('GET', url_str) -+ return body -diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py -index d98b6a7..c3e6396 100644 ---- a/heatclient/v1/shell.py -+++ b/heatclient/v1/shell.py -@@ -293,6 +293,26 @@ def do_stack_list(hc, args={}): - utils.print_list(stacks, fields, sortby=3) - - -+def do_resource_type_list(hc, args={}): -+ '''List the available resource types.''' -+ kwargs = {} -+ types = hc.resource_types.list(**kwargs) -+ utils.print_list(types, ['resource_type']) -+ -+ -+@utils.arg('resource_type', metavar='', -+ help='Resource Type to get the details for.') -+def do_resource_type_show(hc, args={}): -+ '''Show the resource type.''' -+ try: -+ resource_type = hc.resource_types.get(args.resource_type) -+ except exc.HTTPNotFound: -+ raise exc.CommandError( -+ 'Resource Type not found: %s' % args.resource_type) -+ else: -+ print(json.dumps(resource_type, indent=2)) -+ -+ - @utils.arg('id', metavar='', - help='Name or ID of stack to get the template for.') - def do_gettemplate(hc, args): diff --git a/python-heatclient.spec b/python-heatclient.spec index 162c1e6..e93fbe7 100644 --- a/python-heatclient.spec +++ b/python-heatclient.spec @@ -1,6 +1,6 @@ Name: python-heatclient -Version: 0.2.6 -Release: 3%{?dist} +Version: 0.2.9 +Release: 1%{?dist} Summary: Python API and CLI for OpenStack Heat Group: Development/Languages @@ -9,11 +9,10 @@ URL: http://pypi.python.org/pypi/python-heatclient Source0: http://tarballs.openstack.org/%{name}/%{name}-%{version}.tar.gz # -# patches_base=0.2.6 +# patches_base=0.2.9 # Patch0001: 0001-Nuke-pbr-requirements-handling.patch Patch0002: 0002-Remove-runtime-dependency-on-python-pbr.patch -Patch0003: 0003-Add-support-for-resource_types.patch BuildArch: noarch @@ -53,7 +52,6 @@ This package contains auto-generated documentation. %patch0001 -p1 %patch0002 -p1 -%patch0003 -p1 # We provide version like this in order to remove runtime dep on pbr. sed -i s/REDHATHEATCLIENTVERSION/%{version}/ heatclient/__init__.py @@ -88,6 +86,9 @@ rm -fr html/.doctrees html/.buildinfo %doc html %changelog +* Tue Apr 15 2014 Jakub Ruzicka 0.2.9-1 +- Update to upstream 0.2.9 + * Mon Jan 06 2014 Jakub Ruzicka 0.2.6-3 - Add support for resource_types diff --git a/sources b/sources index 4c5db97..53289a5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -20ee4f01f41820fa879f925aa5cf127e python-heatclient-0.2.6.tar.gz +4636989ccbe5c1493f4e4bbf05cf6620 python-heatclient-0.2.9.tar.gz