Hello community, here is the log from the commit of package python-cinderclient for openSUSE:Factory checked in at 2013-07-10 17:30:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-cinderclient (Old) and /work/SRC/openSUSE:Factory/.python-cinderclient.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-cinderclient" Changes: -------- --- /work/SRC/openSUSE:Factory/python-cinderclient/python-cinderclient.changes 2013-07-03 16:52:38.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.python-cinderclient.new/python-cinderclient.changes 2013-07-10 17:30:36.000000000 +0200 @@ -1,0 +2,19 @@ +Fri Jul 5 23:42:47 UTC 2013 - opensuse-cloud@opensuse.org + +- Update to version 1.0.4.56: + + Implement ability to extend volume. + + Enable ability to reset state on snapshots. + +------------------------------------------------------------------- +Wed Jul 3 08:38:49 UTC 2013 - opensuse-cloud@opensuse.org + +- Update to version 1.0.4.52: + + Use exceptions from oslo + +------------------------------------------------------------------- +Tue Jul 2 23:44:53 UTC 2013 - opensuse-cloud@opensuse.org + +- Update to version 1.0.4.50: + + Fix volume info display error on create with v2. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cinderclient.spec ++++++ --- /var/tmp/diff_new_pack.jKNere/_old 2013-07-10 17:30:37.000000000 +0200 +++ /var/tmp/diff_new_pack.jKNere/_new 2013-07-10 17:30:37.000000000 +0200 @@ -19,7 +19,7 @@ %define component cinderclient Name: python-%{component} -Version: 1.0.4.49 +Version: 1.0.4.56 Release: 0 Summary: Openstack Block Storage (Cinder) API Client License: Apache-2.0 @@ -84,7 +84,7 @@ This package contains testsuite files for %{name}. %prep -%setup -q -n python-cinderclient-1.0.4.49.g273a829 +%setup -q -n python-cinderclient-1.0.4.56.ga3985ee %openstack_cleanup_prep echo %{version} > cinderclient/versioninfo ++++++ python-cinderclient-master.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/ChangeLog new/python-cinderclient-1.0.4.56.ga3985ee/ChangeLog --- old/python-cinderclient-1.0.4.49.g273a829/ChangeLog 2013-06-25 22:37:03.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/ChangeLog 2013-07-05 18:45:44.000000000 +0200 @@ -1,3 +1,72 @@ +commit a3985eeb63506b48e2d71143b4b9060442d0bc61 +Merge: a7a48b8 ee9f035 +Author: Jenkins <jenkins@review.openstack.org> +Date: Fri Jul 5 16:45:06 2013 +0000 + + Merge "Enable ability to reset state on snapshots." + +commit a7a48b8fee1654cdd9a4e24fc061cc36d2702ce8 +Merge: 14108c1 10df5be +Author: Jenkins <jenkins@review.openstack.org> +Date: Fri Jul 5 16:37:03 2013 +0000 + + Merge "Implement ability to extend volume." + +commit ee9f0354ec7c0084c0f8cfe2b670589e0d326421 +Author: John Griffith <john.griffith@solidfire.com> +Date: Mon Jul 1 21:17:30 2013 -0600 + + Enable ability to reset state on snapshots. + + Implement the ability to reset-state on snapshots, + exposes os-reset_status from snapshot actions. + + Change-Id: I605f41e39fde46ccfe6a53222b798f32c14bc1f8 + +commit 14108c1e7881021c68989ca71e1e2709ab80de03 +Merge: 8e7cc89 a7cce08 +Author: Jenkins <jenkins@review.openstack.org> +Date: Wed Jul 3 07:53:47 2013 +0000 + + Merge "Use exceptions from oslo" + +commit 10df5beb397dee9f0bde20b87aa23035cc53ede7 +Author: John Griffith <john.griffith@solidfire.com> +Date: Mon Jun 10 14:52:57 2013 -0600 + + Implement ability to extend volume. + + Implements ability to call extend volume in Version 2 API. + + This change includes the needed support in cinderlcient to + utilize/access changes made in the volume-resize change. + + Change-Id: Ifc7e2969b885a60e8105b5f3908ac452d0a61fa7 + +commit a7cce08eab5e2e42275b84bd56127bd09b00f5bf +Author: Alessio Ababilov <ilovegnulinux@gmail.com> +Date: Sun May 19 18:12:27 2013 +0300 + + Use exceptions from oslo + + These exceptions can be used in novaclient, keystoneclient, + glanceclient, and other client projects. + + Partially implements: blueprint common-client-library + + Change-Id: I43918316622b1c1d722872fe30199db6a3a7bb76 + +commit 8e7cc89d058d773ada13d615c1d978ae9d73917c +Author: Avishay Traeger <avishay@il.ibm.com> +Date: Fri Jun 14 08:42:49 2013 +0300 + + Fix volume info display error on create with v2. + + Error due to popping 'links' when it does not exist. + + Change-Id: I3f25b97f16699373ef12d9ac47905900b4b631f8 + Fixes: bug 1190853 + commit 273a82967170ecf4d44973d0dd7baf9c21f4da08 Merge: dcc2f67 7571232 Author: Jenkins <jenkins@review.openstack.org> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/PKG-INFO new/python-cinderclient-1.0.4.56.ga3985ee/PKG-INFO --- old/python-cinderclient-1.0.4.49.g273a829/PKG-INFO 2013-06-25 22:37:04.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/PKG-INFO 2013-07-05 18:45:46.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-cinderclient -Version: 1.0.4.49.g273a829 +Version: 1.0.4.56.ga3985ee Summary: OpenStack Block Storage API Client Library Home-page: http://www.openstack.org/ Author: OpenStack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/base.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/base.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/base.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/base.py 2013-07-05 18:45:13.000000000 +0200 @@ -25,7 +25,7 @@ import six -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient import utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/client.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/client.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/client.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/client.py 2013-07-05 18:45:13.000000000 +0200 @@ -46,7 +46,7 @@ import requests -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient import service_catalog from cinderclient import utils @@ -151,7 +151,7 @@ body = None if resp.status_code >= 400: - raise exceptions.from_response(resp, body) + raise exceptions.from_response(resp, method, url) return resp, body @@ -185,7 +185,7 @@ except exceptions.ClientException as e: if attempts > self.retries: raise - if 500 <= e.code <= 599: + if 500 <= e.http_status <= 599: pass else: raise @@ -211,15 +211,16 @@ def delete(self, url, **kwargs): return self._cs_request(url, 'DELETE', **kwargs) - def _extract_service_catalog(self, url, resp, body, extract_token=True): + def _extract_service_catalog(self, auth_url, url, method, + extract_token=True, **kwargs): """See what the auth service told us and process the response. We may get redirected to another site, fail or actually get back a service catalog with a token and our endpoints. """ - + resp, body = self.request(url, method, **kwargs) if resp.status_code == 200: # content must always present try: - self.auth_url = url + self.auth_url = auth_url self.service_catalog = \ service_catalog.ServiceCatalog(body) @@ -248,7 +249,7 @@ elif resp.status_code == 305: return resp['location'] else: - raise exceptions.from_response(resp, body) + raise exceptions.from_response(resp, method, url) def _fetch_endpoints_from_auth(self, url): """We have a token, but don't know the final endpoint for @@ -263,13 +264,14 @@ """ # GET ...:5001/v2.0/tokens/#####/endpoints + auth_url = url url = '/'.join([url, 'tokens', '%s?belongsTo=%s' % (self.proxy_token, self.proxy_tenant_id)]) self._logger.debug("Using Endpoint URL: %s" % url) - resp, body = self.request(url, "GET", - headers={'X-Auth-Token': self.auth_token}) - return self._extract_service_catalog(url, resp, body, - extract_token=False) + return self._extract_service_catalog( + auth_url, + url, "GET", headers={'X-Auth-Token': self.auth_token}, + extract_token=False) def authenticate(self): magic_tuple = urlparse.urlsplit(self.auth_url) @@ -320,7 +322,9 @@ def _v1_auth(self, url): if self.proxy_token: - raise exceptions.NoTokenLookupException() + raise exceptions.AuthorizationFailure( + "This form of authentication does not support looking up" + " endpoints from an existing token.") headers = {'X-Auth-User': self.user, 'X-Auth-Key': self.password} @@ -339,7 +343,7 @@ elif resp.status_code == 305: return resp.headers['location'] else: - raise exceptions.from_response(resp, body) + raise exceptions.from_response(resp, "GET", url) def _v2_auth(self, url): """Authenticate against a v2.0 auth service.""" @@ -369,14 +373,13 @@ token_url = url + "/tokens" # Make sure we follow redirects when trying to reach Keystone - resp, body = self.request( + return self._extract_service_catalog( + url, token_url, "POST", body=body, allow_redirects=True) - return self._extract_service_catalog(url, resp, body) - def get_volume_api_version_from_endpoint(self): magic_tuple = urlparse.urlsplit(self.management_url) scheme, netloc, path, query, frag = magic_tuple diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/exceptions.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/exceptions.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/exceptions.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/exceptions.py 2013-07-05 18:45:13.000000000 +0200 @@ -1,156 +1,6 @@ -# Copyright 2010 Jacob Kaplan-Moss """ -Exception definitions. +Backwards compatible exceptions module. """ - -class UnsupportedVersion(Exception): - """Indicates that the user is trying to use an unsupported - version of the API. - """ - pass - - -class InvalidAPIVersion(Exception): - pass - - -class CommandError(Exception): - pass - - -class AuthorizationFailure(Exception): - pass - - -class NoUniqueMatch(Exception): - pass - - -class NoTokenLookupException(Exception): - """This form of authentication does not support looking up - endpoints from an existing token. - """ - pass - - -class EndpointNotFound(Exception): - """Could not find Service or Region in Service Catalog.""" - pass - - -class AmbiguousEndpoints(Exception): - """Found more than one matching endpoint in Service Catalog.""" - def __init__(self, endpoints=None): - self.endpoints = endpoints - - def __str__(self): - return "AmbiguousEndpoints: %s" % repr(self.endpoints) - - -class ClientException(Exception): - """ - The base exception class for all exceptions this library raises. - """ - def __init__(self, code, message=None, details=None, request_id=None): - self.code = code - self.message = message or self.__class__.message - self.details = details - self.request_id = request_id - - def __str__(self): - formatted_string = "%s (HTTP %s)" % (self.message, self.code) - if self.request_id: - formatted_string += " (Request-ID: %s)" % self.request_id - - return formatted_string - - -class BadRequest(ClientException): - """ - HTTP 400 - Bad request: you sent some malformed data. - """ - http_status = 400 - message = "Bad request" - - -class Unauthorized(ClientException): - """ - HTTP 401 - Unauthorized: bad credentials. - """ - http_status = 401 - message = "Unauthorized" - - -class Forbidden(ClientException): - """ - HTTP 403 - Forbidden: your credentials don't give you access to this - resource. - """ - http_status = 403 - message = "Forbidden" - - -class NotFound(ClientException): - """ - HTTP 404 - Not found - """ - http_status = 404 - message = "Not found" - - -class OverLimit(ClientException): - """ - HTTP 413 - Over limit: you're over the API limits for this time period. - """ - http_status = 413 - message = "Over limit" - - -# NotImplemented is a python keyword. -class HTTPNotImplemented(ClientException): - """ - HTTP 501 - Not Implemented: the server does not support this operation. - """ - http_status = 501 - message = "Not Implemented" - - -# In Python 2.4 Exception is old-style and thus doesn't have a __subclasses__() -# so we can do this: -# _code_map = dict((c.http_status, c) -# for c in ClientException.__subclasses__()) -# -# Instead, we have to hardcode it: -_code_map = dict((c.http_status, c) for c in [BadRequest, Unauthorized, - Forbidden, NotFound, - OverLimit, HTTPNotImplemented]) - - -def from_response(response, body): - """ - Return an instance of an ClientException or subclass - based on an requests response. - - Usage:: - - resp, body = requests.request(...) - if resp.status_code != 200: - raise exception_from_response(resp, rest.text) - """ - cls = _code_map.get(response.status_code, ClientException) - if response.headers: - request_id = response.headers.get('x-compute-request-id') - else: - request_id = None - if body: - message = "n/a" - details = "n/a" - if hasattr(body, 'keys'): - error = body[list(body.keys())[0]] - message = error.get('message', None) - details = error.get('details', None) - return cls(code=response.status_code, message=message, details=details, - request_id=request_id) - else: - return cls(code=response.status_code, request_id=request_id) +# flake8: noqa +from cinderclient.openstack.common.apiclient.exceptions import * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/openstack/common/apiclient/__init__.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/openstack/common/apiclient/__init__.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/openstack/common/apiclient/__init__.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/openstack/common/apiclient/__init__.py 2013-07-05 18:45:13.000000000 +0200 @@ -0,0 +1,16 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2013 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/openstack/common/apiclient/exceptions.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/openstack/common/apiclient/exceptions.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/openstack/common/apiclient/exceptions.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/openstack/common/apiclient/exceptions.py 2013-07-05 18:45:13.000000000 +0200 @@ -0,0 +1,446 @@ +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright 2010 Jacob Kaplan-Moss +# Copyright 2011 Nebula, Inc. +# Copyright 2013 Alessio Ababilov +# Copyright 2013 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. + +""" +Exception definitions. +""" + +import sys + + +class ClientException(Exception): + """The base exception class for all exceptions this library raises. + """ + pass + + +class MissingArgs(ClientException): + """Supplied arguments are not sufficient for calling a function.""" + def __init__(self, missing): + self.missing = missing + msg = "Missing argument(s): %s" % ", ".join(missing) + super(MissingArgs, self).__init__(msg) + + +class ValidationError(ClientException): + """Error in validation on API client side.""" + pass + + +class UnsupportedVersion(ClientException): + """User is trying to use an unsupported version of the API.""" + pass + + +class CommandError(ClientException): + """Error in CLI tool.""" + pass + + +class AuthorizationFailure(ClientException): + """Cannot authorize API client.""" + pass + + +class AuthPluginOptionsMissing(AuthorizationFailure): + """Auth plugin misses some options.""" + def __init__(self, opt_names): + super(AuthPluginOptionsMissing, self).__init__( + "Authentication failed. Missing options: %s" % + ", ".join(opt_names)) + self.opt_names = opt_names + + +class AuthSystemNotFound(AuthorizationFailure): + """User has specified a AuthSystem that is not installed.""" + def __init__(self, auth_system): + super(AuthSystemNotFound, self).__init__( + "AuthSystemNotFound: %s" % repr(auth_system)) + self.auth_system = auth_system + + +class NoUniqueMatch(ClientException): + """Multiple entities found instead of one.""" + pass + + +class EndpointException(ClientException): + """Something is rotten in Service Catalog.""" + pass + + +class EndpointNotFound(EndpointException): + """Could not find requested endpoint in Service Catalog.""" + pass + + +class AmbiguousEndpoints(EndpointException): + """Found more than one matching endpoint in Service Catalog.""" + def __init__(self, endpoints=None): + super(AmbiguousEndpoints, self).__init__( + "AmbiguousEndpoints: %s" % repr(endpoints)) + self.endpoints = endpoints + + +class HttpError(ClientException): + """The base exception class for all HTTP exceptions. + """ + http_status = 0 + message = "HTTP Error" + + def __init__(self, message=None, details=None, + response=None, request_id=None, + url=None, method=None, http_status=None): + self.http_status = http_status or self.http_status + self.message = message or self.message + self.details = details + self.request_id = request_id + self.response = response + self.url = url + self.method = method + formatted_string = "%s (HTTP %s)" % (self.message, self.http_status) + if request_id: + formatted_string += " (Request-ID: %s)" % request_id + super(HttpError, self).__init__(formatted_string) + + +class HttpClientError(HttpError): + """Client-side HTTP error. + + Exception for cases in which the client seems to have erred. + """ + message = "HTTP Client Error" + + +class HttpServerError(HttpError): + """Server-side HTTP error. + + Exception for cases in which the server is aware that it has + erred or is incapable of performing the request. + """ + message = "HTTP Server Error" + + +class BadRequest(HttpClientError): + """HTTP 400 - Bad Request. + + The request cannot be fulfilled due to bad syntax. + """ + http_status = 400 + message = "Bad Request" + + +class Unauthorized(HttpClientError): + """HTTP 401 - Unauthorized. + + Similar to 403 Forbidden, but specifically for use when authentication + is required and has failed or has not yet been provided. + """ + http_status = 401 + message = "Unauthorized" + + +class PaymentRequired(HttpClientError): + """HTTP 402 - Payment Required. + + Reserved for future use. + """ + http_status = 402 + message = "Payment Required" + + +class Forbidden(HttpClientError): + """HTTP 403 - Forbidden. + + The request was a valid request, but the server is refusing to respond + to it. + """ + http_status = 403 + message = "Forbidden" + + +class NotFound(HttpClientError): + """HTTP 404 - Not Found. + + The requested resource could not be found but may be available again + in the future. + """ + http_status = 404 + message = "Not Found" + + +class MethodNotAllowed(HttpClientError): + """HTTP 405 - Method Not Allowed. + + A request was made of a resource using a request method not supported + by that resource. + """ + http_status = 405 + message = "Method Not Allowed" + + +class NotAcceptable(HttpClientError): + """HTTP 406 - Not Acceptable. + + The requested resource is only capable of generating content not + acceptable according to the Accept headers sent in the request. + """ + http_status = 406 + message = "Not Acceptable" + + +class ProxyAuthenticationRequired(HttpClientError): + """HTTP 407 - Proxy Authentication Required. + + The client must first authenticate itself with the proxy. + """ + http_status = 407 + message = "Proxy Authentication Required" + + +class RequestTimeout(HttpClientError): + """HTTP 408 - Request Timeout. + + The server timed out waiting for the request. + """ + http_status = 408 + message = "Request Timeout" + + +class Conflict(HttpClientError): + """HTTP 409 - Conflict. + + Indicates that the request could not be processed because of conflict + in the request, such as an edit conflict. + """ + http_status = 409 + message = "Conflict" + + +class Gone(HttpClientError): + """HTTP 410 - Gone. + + Indicates that the resource requested is no longer available and will + not be available again. + """ + http_status = 410 + message = "Gone" + + +class LengthRequired(HttpClientError): + """HTTP 411 - Length Required. + + The request did not specify the length of its content, which is + required by the requested resource. + """ + http_status = 411 + message = "Length Required" + + +class PreconditionFailed(HttpClientError): + """HTTP 412 - Precondition Failed. + + The server does not meet one of the preconditions that the requester + put on the request. + """ + http_status = 412 + message = "Precondition Failed" + + +class RequestEntityTooLarge(HttpClientError): + """HTTP 413 - Request Entity Too Large. + + The request is larger than the server is willing or able to process. + """ + http_status = 413 + message = "Request Entity Too Large" + + def __init__(self, *args, **kwargs): + try: + self.retry_after = int(kwargs.pop('retry_after')) + except (KeyError, ValueError): + self.retry_after = 0 + + super(RequestEntityTooLarge, self).__init__(*args, **kwargs) + + +class RequestUriTooLong(HttpClientError): + """HTTP 414 - Request-URI Too Long. + + The URI provided was too long for the server to process. + """ + http_status = 414 + message = "Request-URI Too Long" + + +class UnsupportedMediaType(HttpClientError): + """HTTP 415 - Unsupported Media Type. + + The request entity has a media type which the server or resource does + not support. + """ + http_status = 415 + message = "Unsupported Media Type" + + +class RequestedRangeNotSatisfiable(HttpClientError): + """HTTP 416 - Requested Range Not Satisfiable. + + The client has asked for a portion of the file, but the server cannot + supply that portion. + """ + http_status = 416 + message = "Requested Range Not Satisfiable" + + +class ExpectationFailed(HttpClientError): + """HTTP 417 - Expectation Failed. + + The server cannot meet the requirements of the Expect request-header field. + """ + http_status = 417 + message = "Expectation Failed" + + +class UnprocessableEntity(HttpClientError): + """HTTP 422 - Unprocessable Entity. + + The request was well-formed but was unable to be followed due to semantic + errors. + """ + http_status = 422 + message = "Unprocessable Entity" + + +class InternalServerError(HttpServerError): + """HTTP 500 - Internal Server Error. + + A generic error message, given when no more specific message is suitable. + """ + http_status = 500 + message = "Internal Server Error" + + +# NotImplemented is a python keyword. +class HttpNotImplemented(HttpServerError): + """HTTP 501 - Not Implemented. + + The server either does not recognize the request method, or it lacks + the ability to fulfill the request. + """ + http_status = 501 + message = "Not Implemented" + + +class BadGateway(HttpServerError): + """HTTP 502 - Bad Gateway. + + The server was acting as a gateway or proxy and received an invalid + response from the upstream server. + """ + http_status = 502 + message = "Bad Gateway" + + +class ServiceUnavailable(HttpServerError): + """HTTP 503 - Service Unavailable. + + The server is currently unavailable. + """ + http_status = 503 + message = "Service Unavailable" + + +class GatewayTimeout(HttpServerError): + """HTTP 504 - Gateway Timeout. + + The server was acting as a gateway or proxy and did not receive a timely + response from the upstream server. + """ + http_status = 504 + message = "Gateway Timeout" + + +class HttpVersionNotSupported(HttpServerError): + """HTTP 505 - HttpVersion Not Supported. + + The server does not support the HTTP protocol version used in the request. + """ + http_status = 505 + message = "HTTP Version Not Supported" + + +# In Python 2.4 Exception is old-style and thus doesn't have a __subclasses__() +# so we can do this: +# _code_map = dict((c.http_status, c) +# for c in HttpError.__subclasses__()) +_code_map = {} +for obj in sys.modules[__name__].__dict__.values(): + if isinstance(obj, type): + try: + http_status = obj.http_status + except AttributeError: + pass + else: + if http_status: + _code_map[http_status] = obj + + +def from_response(response, method, url): + """Returns an instance of :class:`HttpError` or subclass based on response. + + :param response: instance of `requests.Response` class + :param method: HTTP method used for request + :param url: URL used for request + """ + kwargs = { + "http_status": response.status_code, + "response": response, + "method": method, + "url": url, + "request_id": response.headers.get("x-compute-request-id"), + } + if "retry-after" in response.headers: + kwargs["retry_after"] = response.headers["retry-after"] + + content_type = response.headers.get("Content-Type", "") + if content_type.startswith("application/json"): + try: + body = response.json() + except ValueError: + pass + else: + if hasattr(body, "keys"): + error = body[body.keys()[0]] + kwargs["message"] = error.get("message", None) + kwargs["details"] = error.get("details", None) + elif content_type.startswith("text/"): + kwargs["details"] = response.text + + try: + cls = _code_map[response.status_code] + except KeyError: + if 500 <= response.status_code < 600: + cls = HttpServerError + elif 400 <= response.status_code < 500: + cls = HttpClientError + else: + cls = HttpError + return cls(**kwargs) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/shell.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/shell.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/shell.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/shell.py 2013-07-05 18:45:13.000000000 +0200 @@ -32,8 +32,8 @@ import six from cinderclient import client -from cinderclient import exceptions as exc import cinderclient.extension +from cinderclient.openstack.common.apiclient import exceptions as exc from cinderclient.openstack.common import strutils from cinderclient import utils from cinderclient.v1 import shell as shell_v1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/test_base.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/test_base.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/test_base.py 2013-06-25 22:36:29.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/test_base.py 2013-07-05 18:45:13.000000000 +0200 @@ -1,5 +1,5 @@ from cinderclient import base -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient.v1 import volumes from cinderclient.tests import utils from cinderclient.tests.v1 import fakes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/test_http.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/test_http.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/test_http.py 2013-06-25 22:36:29.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/test_http.py 2013-07-05 18:45:13.000000000 +0200 @@ -3,7 +3,7 @@ import requests from cinderclient import client -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient.tests import utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/test_service_catalog.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/test_service_catalog.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/test_service_catalog.py 2013-06-25 22:36:29.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/test_service_catalog.py 2013-07-05 18:45:13.000000000 +0200 @@ -1,4 +1,4 @@ -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient import service_catalog from cinderclient.tests import utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/test_shell.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/test_shell.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/test_shell.py 2013-06-25 22:36:29.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/test_shell.py 2013-07-05 18:45:13.000000000 +0200 @@ -5,7 +5,7 @@ from six import moves from testtools import matchers -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions import cinderclient.shell from cinderclient.tests import utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/test_utils.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/test_utils.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/test_utils.py 2013-06-25 22:36:29.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/test_utils.py 2013-07-05 18:45:13.000000000 +0200 @@ -3,7 +3,7 @@ from six import moves -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient import utils from cinderclient import base from cinderclient.tests import utils as test_utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/utils.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/utils.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/utils.py 2013-06-25 22:36:29.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/utils.py 2013-07-05 18:45:13.000000000 +0200 @@ -29,10 +29,11 @@ def __init__(self, data): self._text = None + self.headers = {} super(TestResponse, self) if isinstance(data, dict): self.status_code = data.get('status_code', None) - self.headers = data.get('headers', None) + self.headers = data.get('headers') or {} # Fake the text attribute to streamline Response creation self._text = data.get('text', None) else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v1/fakes.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v1/fakes.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v1/fakes.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v1/fakes.py 2013-07-05 18:45:13.000000000 +0200 @@ -231,6 +231,17 @@ snapshot.update(kw['body']['snapshot']) return (200, {}, {'snapshot': snapshot}) + def post_snapshots_1234_action(self, body, **kw): + _body = None + resp = 202 + assert len(body.keys()) == 1 + action = body.keys()[0] + if action == 'os-reset_status': + assert 'status' in body['os-reset_status'] + else: + raise AssertionError('Unexpected action: %s" % action') + return (resp, {}, _body) + # # Volumes # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v1/test_auth.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v1/test_auth.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v1/test_auth.py 2013-06-25 22:36:29.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v1/test_auth.py 2013-07-05 18:45:13.000000000 +0200 @@ -4,7 +4,7 @@ import requests from cinderclient.v1 import client -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient.tests import utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v1/test_shell.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v1/test_shell.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v1/test_shell.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v1/test_shell.py 2013-07-05 18:45:13.000000000 +0200 @@ -189,3 +189,13 @@ self.run_command('reset-state --state error 1234') expected = {'os-reset_status': {'status': 'error'}} self.assert_called('POST', '/volumes/1234/action', body=expected) + + def test_snapshot_reset_state(self): + self.run_command('snapshot-reset-state 1234') + expected = {'os-reset_status': {'status': 'available'}} + self.assert_called('POST', '/snapshots/1234/action', body=expected) + + def test_snapshot_reset_state_with_flag(self): + self.run_command('snapshot-reset-state --state error 1234') + expected = {'os-reset_status': {'status': 'error'}} + self.assert_called('POST', '/snapshots/1234/action', body=expected) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v2/fakes.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v2/fakes.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v2/fakes.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v2/fakes.py 2013-07-05 18:45:13.000000000 +0200 @@ -159,6 +159,10 @@ } +def _stub_extend(id, new_size): + return {'volume_id': '712f4980-5ac1-41e5-9383-390aa7c9f58b'} + + class FakeClient(fakes.FakeClient, client.Client): def __init__(self, *args, **kwargs): @@ -238,6 +242,17 @@ snapshot.update(kw['body']['snapshot']) return (200, {}, {'snapshot': snapshot}) + def post_snapshots_1234_action(self, body, **kw): + _body = None + resp = 202 + assert len(body.keys()) == 1 + action = body.keys()[0] + if action == 'os-reset_status': + assert 'status' in body['os-reset_status'] + else: + raise AssertionError('Unexpected action: %s" % action') + return (resp, {}, _body) + # # Volumes # @@ -290,6 +305,8 @@ assert body[action] is None elif action == 'os-reset_status': assert 'status' in body[action] + elif action == 'os-extend': + assert body[action].keys() == ['new_size'] else: raise AssertionError("Unexpected action: %s" % action) return (resp, {}, _body) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v2/test_auth.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v2/test_auth.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v2/test_auth.py 2013-06-25 22:36:29.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v2/test_auth.py 2013-07-05 18:45:13.000000000 +0200 @@ -19,7 +19,7 @@ import mock import requests -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient.v2 import client from cinderclient.tests import utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v2/test_shell.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v2/test_shell.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v2/test_shell.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v2/test_shell.py 2013-07-05 18:45:13.000000000 +0200 @@ -167,3 +167,13 @@ self.run_command('reset-state --state error 1234') expected = {'os-reset_status': {'status': 'error'}} self.assert_called('POST', '/volumes/1234/action', body=expected) + + def test_snapshot_reset_state(self): + self.run_command('snapshot-reset-state 1234') + expected = {'os-reset_status': {'status': 'available'}} + self.assert_called('POST', '/snapshots/1234/action', body=expected) + + def test_snapshot_reset_state_with_flag(self): + self.run_command('snapshot-reset-state --state error 1234') + expected = {'os-reset_status': {'status': 'error'}} + self.assert_called('POST', '/snapshots/1234/action', body=expected) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v2/test_volumes.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v2/test_volumes.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/tests/v2/test_volumes.py 2013-06-25 22:36:29.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/tests/v2/test_volumes.py 2013-07-05 18:45:13.000000000 +0200 @@ -85,3 +85,8 @@ keys = ['key1'] cs.volumes.delete_metadata(1234, keys) cs.assert_called('DELETE', '/volumes/1234/metadata/key1') + + def test_extend(self): + v = cs.volumes.get('1234') + cs.volumes.extend(v, 2) + cs.assert_called('POST', '/volumes/1234/action') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/utils.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/utils.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/utils.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/utils.py 2013-07-05 18:45:13.000000000 +0200 @@ -23,7 +23,7 @@ import six import prettytable -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient.openstack.common import strutils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/v1/shell.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/v1/shell.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/v1/shell.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/v1/shell.py 2013-07-05 18:45:13.000000000 +0200 @@ -22,7 +22,7 @@ import sys import time -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient import utils @@ -443,6 +443,21 @@ _find_volume_snapshot(cs, args.snapshot).update(**kwargs) +@utils.arg('snapshot', metavar='<snapshot>', + help='ID of the snapshot to modify.') +@utils.arg('--state', metavar='<state>', + default='available', + help=('Indicate which state to assign the snapshot. ' + 'Options include available, error, creating, deleting, ' + 'error_deleting. If no state is provided, ' + 'available will be used.')) +@utils.service_type('volume') +def do_snapshot_reset_state(cs, args): + """Explicitly update the state of a snapshot.""" + snapshot = _find_volume_snapshot(cs, args.snapshot) + snapshot.reset_state(args.state) + + def _print_volume_type_list(vtypes): utils.print_list(vtypes, ['ID', 'Name']) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/v1/volume_snapshots.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/v1/volume_snapshots.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/v1/volume_snapshots.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/v1/volume_snapshots.py 2013-07-05 18:45:13.000000000 +0200 @@ -53,6 +53,10 @@ def project_id(self): return self._info.get('os-extended-snapshot-attributes:project_id') + def reset_state(self, state): + """Update the snapshot with the privided state.""" + self.manager.reset_state(self, state) + class SnapshotManager(base.ManagerWithFind): """ @@ -133,3 +137,14 @@ body = {"snapshot": kwargs} self._update("/snapshots/%s" % base.getid(snapshot), body) + + def reset_state(self, snapshot, state): + """Update the specified volume with the provided state.""" + return self._action('os-reset_status', snapshot, {'status': state}) + + def _action(self, action, snapshot, info=None, **kwargs): + """Perform a snapshot action.""" + body = {action: info} + self.run_hooks('modify_body_for_action', body, **kwargs) + url = '/snapshots/%s/action' % base.getid(snapshot) + return self.api.client.post(url, body=body) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/v2/shell.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/v2/shell.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/v2/shell.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/v2/shell.py 2013-07-05 18:45:13.000000000 +0200 @@ -22,7 +22,7 @@ import six -from cinderclient import exceptions +from cinderclient.openstack.common.apiclient import exceptions from cinderclient import utils @@ -170,9 +170,7 @@ volume = _find_volume(cs, args.volume) info.update(volume._info) - if 'links' in info: - info.pop('links') - + info.pop('links', None) utils.print_dict(info) @@ -282,8 +280,7 @@ volume = cs.volumes.get(volume.id) info.update(volume._info) - info.pop('links') - + info.pop('links', None) utils.print_dict(info) @@ -512,6 +509,21 @@ _find_volume_snapshot(cs, args.snapshot).update(**kwargs) +@utils.arg('snapshot', metavar='<snapshot>', + help='ID of the snapshot to modify.') +@utils.arg('--state', metavar='<state>', + default='available', + help=('Indicate which state to assign the snapshot. ' + 'Options include available, error, creating, ' + 'deleting, error_deleting. If no state is provided, ' + 'available will be used.')) +@utils.service_type('snapshot') +def do_snapshot_reset_state(cs, args): + """Explicitly update the state of a snapshot.""" + snapshot = _find_volume_snapshot(cs, args.snapshot) + snapshot.reset_state(args.state) + + def _print_volume_type_list(vtypes): utils.print_list(vtypes, ['ID', 'Name']) @@ -792,9 +804,7 @@ info = dict() info.update(backup._info) - if 'links' in info: - info.pop('links') - + info.pop('links', None) utils.print_dict(info) @@ -847,9 +857,7 @@ info = dict() info.update(transfer._info) - if 'links' in info: - info.pop('links') - + info.pop('links', None) utils.print_dict(info) @@ -873,9 +881,7 @@ info = dict() info.update(transfer._info) - if 'links' in info: - info.pop('links') - + info.pop('links', None) utils.print_dict(info) @@ -896,7 +902,17 @@ info = dict() info.update(transfer._info) - if 'links' in info: - info.pop('links') - + info.pop('links', None) utils.print_dict(info) + + +@utils.arg('volume', metavar='<volume>', help='ID of the volume to extend.') +@utils.arg('new-size', + metavar='<new_size>', + type=int, + help='New size of volume in GB') +@utils.service_type('volume') +def do_extend(cs, args): + """Attempt to extend the size of an existing volume.""" + volume = _find_volume(cs, args.volume) + cs.volumes.extend_volume(volume, args.new_size) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/v2/volume_snapshots.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/v2/volume_snapshots.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/v2/volume_snapshots.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/v2/volume_snapshots.py 2013-07-05 18:45:13.000000000 +0200 @@ -45,6 +45,10 @@ def project_id(self): return self._info.get('os-extended-snapshot-attributes:project_id') + def reset_state(self, state): + """Update the snapshot with the provided state.""" + self.manager.reset_state(self, state) + class SnapshotManager(base.ManagerWithFind): """Manage :class:`Snapshot` resources.""" @@ -118,3 +122,14 @@ body = {"snapshot": kwargs} self._update("/snapshots/%s" % base.getid(snapshot), body) + + def reset_state(self, snapshot, state): + """Update the specified snapshot with the provided state.""" + return self._action('os-reset_status', snapshot, {'status': state}) + + def _action(self, action, snapshot, info=None, **kwargs): + """Perform a snapshot action.""" + body = {action: info} + self.run_hooks('modify_body_for_action', body, **kwargs) + url = '/snapshots/%s/action' % base.getid(snapshot) + return self.api.client.post(url, body=body) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/cinderclient/v2/volumes.py new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/v2/volumes.py --- old/python-cinderclient-1.0.4.49.g273a829/cinderclient/v2/volumes.py 2013-06-25 22:36:31.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/cinderclient/v2/volumes.py 2013-07-05 18:45:13.000000000 +0200 @@ -104,6 +104,14 @@ """Update the volume with the provided state.""" self.manager.reset_state(self, state) + def extend(self, volume, new_size): + """Extend the size of the specified volume. + :param volume: The UUID of the volume to extend + :param new_size: The desired size to extend volume to. + """ + + self.manager.extend(self, volume, new_size) + class VolumeManager(base.ManagerWithFind): """Manage :class:`Volume` resources.""" @@ -321,3 +329,8 @@ def reset_state(self, volume, state): """Update the provided volume with the provided state.""" return self._action('os-reset_status', volume, {'status': state}) + + def extend(self, volume, new_size): + return self._action('os-extend', + base.getid(volume), + {'new_size': new_size}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/openstack-common.conf new/python-cinderclient-1.0.4.56.ga3985ee/openstack-common.conf --- old/python-cinderclient-1.0.4.49.g273a829/openstack-common.conf 2013-06-25 22:36:29.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/openstack-common.conf 2013-07-05 18:45:13.000000000 +0200 @@ -1,7 +1,7 @@ [DEFAULT] # The list of modules to copy from openstack-common -modules=strutils +modules=apiclient,strutils # The base module to hold the copy of openstack.common base=cinderclient diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/python_cinderclient.egg-info/PKG-INFO new/python-cinderclient-1.0.4.56.ga3985ee/python_cinderclient.egg-info/PKG-INFO --- old/python-cinderclient-1.0.4.49.g273a829/python_cinderclient.egg-info/PKG-INFO 2013-06-25 22:37:03.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/python_cinderclient.egg-info/PKG-INFO 2013-07-05 18:45:44.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-cinderclient -Version: 1.0.4.49.g273a829 +Version: 1.0.4.56.ga3985ee Summary: OpenStack Block Storage API Client Library Home-page: http://www.openstack.org/ Author: OpenStack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-cinderclient-1.0.4.49.g273a829/python_cinderclient.egg-info/SOURCES.txt new/python-cinderclient-1.0.4.56.ga3985ee/python_cinderclient.egg-info/SOURCES.txt --- old/python-cinderclient-1.0.4.49.g273a829/python_cinderclient.egg-info/SOURCES.txt 2013-06-25 22:37:04.000000000 +0200 +++ new/python-cinderclient-1.0.4.56.ga3985ee/python_cinderclient.egg-info/SOURCES.txt 2013-07-05 18:45:46.000000000 +0200 @@ -25,6 +25,8 @@ cinderclient/openstack/__init__.py cinderclient/openstack/common/__init__.py cinderclient/openstack/common/strutils.py +cinderclient/openstack/common/apiclient/__init__.py +cinderclient/openstack/common/apiclient/exceptions.py cinderclient/tests/__init__.py cinderclient/tests/fakes.py cinderclient/tests/test_base.py -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org