Merge lp:~jaypipes/nova/nova-virt-connection into lp:~hudson-openstack/nova/trunk
Proposed by
Jay Pipes
Status: | Merged |
---|---|
Approved by: | Eric Day |
Approved revision: | 219 |
Merged at revision: | 261 |
Proposed branch: | lp:~jaypipes/nova/nova-virt-connection |
Merge into: | lp:~hudson-openstack/nova/trunk |
Prerequisite: | lp:~jaypipes/nova/pylint |
Diff against target: |
230 lines (+63/-26) 2 files modified
nova/tests/api_unittest.py (+58/-25) nova/virt/connection.py (+5/-1) |
To merge this branch: | bzr merge lp:~jaypipes/nova/nova-virt-connection |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vish Ishaya (community) | Approve | ||
Review via email: mp+32208@code.launchpad.net |
Description of the change
pylint fixes for /nova/virt/
To post a comment you must log in.
Not a huge deal, but pylint gives me a deprecation warning on disable-msg,
and says to use disable instead.
Vish
On Tue, Aug 10, 2010 at 7:26 AM, Jay Pipes <email address hidden> wrote:
> Jay Pipes has proposed merging lp:~jaypipes/nova/nova-virt-connection into connection. py /code.launchpad .net/~jaypipes/ nova/nova- virt-connection /+merge/ 32208 api_unittest. py' api_unittest. py 2010-07-27 04:07:28 +0000 api_unittest. py 2010-08-10 14:25:59 +0000 tornado( method, path, headers, data, host, connection=None): differentiated import of tornado( method, path, headers, data, # pylint: Connection instance HTTPHeaders( ) HTTPHeaders( ) iteritems( ): httpresponse( s): HTTPResponse et(s) httpresponse( response_ string) : HTTPResponse" "" et(response_ string) HTTPResponse( sock) et(object) : HTTPResponse, trivial """ StringIO( s) HTTPResponse, trivial""" StringIO( response_ string)
> lp:nova with lp:~jaypipes/nova/pylint as a prerequisite.
>
> Requested reviews:
> Nova Core (nova-core)
>
>
> pylint fixes for /nova/virt/
> --
> https:/
> Your team Nova Core is requested to review the proposed merge of
> lp:~jaypipes/nova/nova-virt-connection into lp:nova.
>
> === modified file 'nova/tests/
> --- nova/tests/
> +++ nova/tests/
> @@ -16,6 +16,8 @@
> # License for the specific language governing permissions and
> limitations
> # under the License.
>
> +"""Unit tests for the API endpoint"""
> +
> import boto
> from boto.ec2 import regioninfo
> import httplib
> @@ -38,7 +40,15 @@
> # circuit boto calls and feed them into our tornado
> handlers,
> # it's pretty damn circuitous so apologies if you have to
> fix
> # a bug in it
> -def boto_to_
> +# NOTE(jaypipes) The pylint disables here are for R0913 (too many args)
> which
> +# isn't controllable since boto's HTTPRequest needs that
> many
> +# args, and for the version-
> tornado's
> +# httputil.
> +# NOTE(jaypipes): The disable-msg=E1101 and E1103 below is because pylint
> is
> +# unable to introspect the deferred's return value
> properly
> +
> +def boto_to_
> disable-msg=R0913
> + host, connection=None):
> """ translate boto requests into tornado requests
>
> connection should be a FakeTornadoHttp
> @@ -46,7 +56,7 @@
> try:
> headers = httpserver.
> except AttributeError:
> - from tornado import httputil
> + from tornado import httputil # pylint: disable-msg=E0611
> headers = httputil.
> for k, v in headers.
> headers[k] = v
> @@ -61,57 +71,64 @@
> return req
>
>
> -def raw_to_
> - """ translate a raw tornado http response into an httplib.
> """
> - sock = FakeHttplibSock
> +def raw_to_
> + """translate a raw tornado http response into an
> httplib.
> + sock = FakeHttplibSock
> resp = httplib.
> resp.begin()
> return resp
>
>
> class FakeHttplibSock
> - """ a fake socket implementation for httplib.
> - def __init__(self, s):
> - self.fp = StringIO.
> + """a fake socket implementation for httplib.
> + def __init__(self, response_string):
> + self._buffer = StringIO.
>
> - def makefile(self, mode, othe...