Merge lp:~tpatil/nova/bug699654 into lp:~hudson-openstack/nova/trunk

Proposed by Tushar Patil
Status: Merged
Approved by: Vish Ishaya
Approved revision: 602
Merged at revision: 620
Proposed branch: lp:~tpatil/nova/bug699654
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 46 lines (+10/-8)
1 file modified
nova/api/ec2/__init__.py (+10/-8)
To merge this branch: bzr merge lp:~tpatil/nova/bug699654
Reviewer Review Type Date Requested Status
Vish Ishaya (community) Approve
Devin Carlen (community) Approve
Jay Pipes Pending
Review via email: mp+47008@code.launchpad.net

Commit message

Fix for LP Bug #699654

Description of the change

Fix for LP Bug #699654

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

20 - LOG.audit(_("Authentication Failure: %s"), str(ex))
21 + LOG.error(_("Authentication Failure: %s"), ex.args[0])

Why was this changed from audit to error?

review: Needs Information
Revision history for this message
Tushar Patil (tpatil) wrote :

My mistake, I will make revert it back to audit.

Revision history for this message
Tushar Patil (tpatil) wrote :

Please review and let me know your comments.

Revision history for this message
Devin Carlen (devcamcar) wrote :

approve

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm.

review: Approve
Revision history for this message
Tushar Patil (tpatil) wrote :

Request to merge this branch into lp:nova if there are no more review comments.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (20.8 KiB)

The attempt to merge lp:~tpatil/nova/bug699654 into lp:nova failed. Below is the output from the failed tests.

AdminAPITest
    test_admin_disabled ok
    test_admin_enabled ok
APITest
    test_exceptions_are_converted_to_faults ok
Test
    test_authorize_token ok
    test_authorize_user ok
    test_bad_token ok
    test_bad_user ok
    test_no_user ok
    test_token_expiry ok
TestLimiter
    test_authorize_token ok
TestFaults
    test_fault_parts ok
    test_raise ok
    test_retry_header ok
FlavorsTest
    test_get_flavor_by_id ok
    test_get_flavor_list ok
GlanceImageServiceTest
    test_create ok
    test_create_and_show_non_existing_image ok
    test_delete ok
    test_update ok
ImageControllerWithGlanceServiceTest
    test_get_image_details ok
    test_get_image_index ok
LocalImageServiceTest
    test_create ok
    test_create_and_show_non_existing_image ok
    test_delete ok
    test_update ok
LimiterTest
    test_minute ok
    test_one_per_period ok
    test_second ok
    test_users_get_separate_buckets ok
    test_we_can_go_indefinitely_if_we_spread_out_requests ok
WSGIAppProxyTest
    test_200 ok
    test_403 ok
    test_failure ok
WSGIAppTest
    test_escaping ok
    test_good_urls ok
    test_invalid_methods ok
    test_invalid_urls ok
    test_response_to_delays ok
ServersTest
    test_create_backup_schedules ok
    test_create_instance ok
    test_delete_backup_schedules ok
    test_delete_server_instance ok
    test_get_all_server_details ok
    test_ge...

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :
Download full text (21.1 KiB)

The attempt to merge lp:~tpatil/nova/bug699654 into lp:nova failed. Below is the output from the failed tests.

AdminAPITest
    test_admin_disabled ok
    test_admin_enabled ok
APITest
    test_exceptions_are_converted_to_faults ok
Test
    test_authorize_token ok
    test_authorize_user ok
    test_bad_token ok
    test_bad_user ok
    test_no_user ok
    test_token_expiry ok
TestLimiter
    test_authorize_token ok
TestFaults
    test_fault_parts ok
    test_raise ok
    test_retry_header ok
FlavorsTest
    test_get_flavor_by_id ok
    test_get_flavor_list ok
GlanceImageServiceTest
    test_create ok
    test_create_and_show_non_existing_image ok
    test_delete ok
    test_update ok
ImageControllerWithGlanceServiceTest
    test_get_image_details ok
    test_get_image_index ok
LocalImageServiceTest
    test_create ok
    test_create_and_show_non_existing_image ok
    test_delete ok
    test_update ok
LimiterTest
    test_minute ok
    test_one_per_period ok
    test_second ok
    test_users_get_separate_buckets ok
    test_we_can_go_indefinitely_if_we_spread_out_requests ok
WSGIAppProxyTest
    test_200 ok
    test_403 ok
    test_failure ok
WSGIAppTest
    test_escaping ok
    test_good_urls ok
    test_invalid_methods ok
    test_invalid_urls ok
    test_response_to_delays ok
ServersTest
    test_create_backup_schedules ok
    test_create_instance ok
    test_delete_backup_schedules ok
    test_delete_server_instance ok
    test_get_all_server_details ok
    test_ge...

Revision history for this message
Vish Ishaya (vishvananda) wrote :

still has pep8 issues.

Vish

On Jan 25, 2011, at 3:24 PM, OpenStack Hudson wrote:

> The proposal to merge lp:~tpatil/nova/bug699654 into lp:nova has been updated.
>
> Status: Approved => Needs review
>
> For more details, see:
> https://code.launchpad.net/~tpatil/nova/bug699654/+merge/47008
> --
> https://code.launchpad.net/~tpatil/nova/bug699654/+merge/47008
> You are reviewing the proposed merge of lp:~tpatil/nova/bug699654 into lp:nova.

Revision history for this message
Tushar Patil (tpatil) wrote :

I already check for pep8 errors and it returned me following

root@ubuntu-network-api-server:/home/tpatil/bugs/bug699654# pep8 .
./doc/ext/nova_autodoc.py:8:1: E302 expected 2 blank lines, found 1
./doc/ext/nova_todo.py:2:80: E501 line too long (88 characters)
./doc/ext/nova_todo.py:25:76: W291 trailing whitespace
./doc/ext/nova_todo.py:27:5: E303 too many blank lines (2)
./doc/ext/nova_todo.py:29:63: E702 multiple statements on one line (semicolon)
./doc/ext/nova_todo.py:29:57: E231 missing whitespace after ','
./doc/ext/nova_todo.py:62:1: W293 blank line contains whitespace
./doc/ext/nova_todo.py:74:34: E701 multiple statements on one line (colon)
./doc/ext/nova_todo.py:82:27: E225 missing whitespace around operator
./doc/ext/nova_todo.py:101:1: W391 blank line at end of file
./doc/source/conf.py:14:11: E401 multiple imports on one line
./doc/source/conf.py:42:3: E111 indentation is not a multiple of four
./smoketests/user_smoketests.py:244:21: W601 .has_key() is deprecated, use 'in'
./tools/ajaxterm/ajaxterm.py:23:5: E301 expected 1 blank line, found 0
./tools/ajaxterm/ajaxterm.py:64:65: E203 whitespace before ':'
./tools/ajaxterm/qweb.py:718:22: E201 whitespace after '('

I didn't see any issues reported in my code, so I was relaxed. But it seems like I need to first run merge, check pep8 for errors and then push the branch again.

Revision history for this message
Vish Ishaya (vishvananda) wrote :

the command is pep8 --repeat nova bin/* (or just ./run_tests.sh) the bin files don't get picked up automatically because they don't end in .py

You also may have an old version of pep8

Vish

On Jan 25, 2011, at 3:38 PM, Tushar Patil wrote:

> I already check for pep8 errors and it returned me following
>
> root@ubuntu-network-api-server:/home/tpatil/bugs/bug699654# pep8 .
> ./doc/ext/nova_autodoc.py:8:1: E302 expected 2 blank lines, found 1
> ./doc/ext/nova_todo.py:2:80: E501 line too long (88 characters)
> ./doc/ext/nova_todo.py:25:76: W291 trailing whitespace
> ./doc/ext/nova_todo.py:27:5: E303 too many blank lines (2)
> ./doc/ext/nova_todo.py:29:63: E702 multiple statements on one line (semicolon)
> ./doc/ext/nova_todo.py:29:57: E231 missing whitespace after ','
> ./doc/ext/nova_todo.py:62:1: W293 blank line contains whitespace
> ./doc/ext/nova_todo.py:74:34: E701 multiple statements on one line (colon)
> ./doc/ext/nova_todo.py:82:27: E225 missing whitespace around operator
> ./doc/ext/nova_todo.py:101:1: W391 blank line at end of file
> ./doc/source/conf.py:14:11: E401 multiple imports on one line
> ./doc/source/conf.py:42:3: E111 indentation is not a multiple of four
> ./smoketests/user_smoketests.py:244:21: W601 .has_key() is deprecated, use 'in'
> ./tools/ajaxterm/ajaxterm.py:23:5: E301 expected 1 blank line, found 0
> ./tools/ajaxterm/ajaxterm.py:64:65: E203 whitespace before ':'
> ./tools/ajaxterm/qweb.py:718:22: E201 whitespace after '('
>
> I didn't see any issues reported in my code, so I was relaxed. But it seems like I need to first run merge, check pep8 for errors and then push the branch again.
> --
> https://code.launchpad.net/~tpatil/nova/bug699654/+merge/47008
> You are reviewing the proposed merge of lp:~tpatil/nova/bug699654 into lp:nova.

Revision history for this message
Vish Ishaya (vishvananda) wrote :

vishvananda@i-uswrlzxk:~/friendly-db$ pep8 --version
0.6.1

Revision history for this message
Tushar Patil (tpatil) wrote :

I have correct pep8 version.
Now I can see the above error when I run the command pep8 -repeat nova bin/*
I will fix it soon. Sorry to bother you again and again.

I am learning lots of new things in this project. Will ensure this problem doesn't happen again.

Revision history for this message
Vish Ishaya (vishvananda) wrote :

Don't worry about it. We're all learning.

Vish

On Jan 25, 2011, at 3:49 PM, Tushar Patil wrote:

> I have correct pep8 version.
> Now I can see the above error when I run the command pep8 -repeat nova bin/*
> I will fix it soon. Sorry to bother you again and again.
>
> I am learning lots of new things in this project. Will ensure this problem doesn't happen again.
>
>
> --
> https://code.launchpad.net/~tpatil/nova/bug699654/+merge/47008
> You are reviewing the proposed merge of lp:~tpatil/nova/bug699654 into lp:nova.

Revision history for this message
Vish Ishaya (vishvananda) wrote :

As a side note, you might want to configure your editor to automatically strip white-space from the end of the lines on save.

lp:~tpatil/nova/bug699654 updated
602. By Tushar Patil

Fixed pep8 errors

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Authors'
2=== modified file 'nova/api/ec2/__init__.py'
3--- nova/api/ec2/__init__.py 2011-01-19 02:00:28 +0000
4+++ nova/api/ec2/__init__.py 2011-01-25 23:57:16 +0000
5@@ -170,7 +170,7 @@
6 req.path)
7 # Be explicit for what exceptions are 403, the rest bubble as 500
8 except (exception.NotFound, exception.NotAuthorized) as ex:
9- LOG.audit(_("Authentication Failure: %s"), str(ex))
10+ LOG.audit(_("Authentication Failure: %s"), ex.args[0])
11 raise webob.exc.HTTPForbidden()
12
13 # Authenticated!
14@@ -314,17 +314,18 @@
15 try:
16 result = api_request.invoke(context)
17 except exception.NotFound as ex:
18- LOG.info(_('NotFound raised: %s'), str(ex), context=context)
19- return self._error(req, context, type(ex).__name__, str(ex))
20+ LOG.info(_('NotFound raised: %s'), ex.args[0], context=context)
21+ return self._error(req, context, type(ex).__name__, ex.args[0])
22 except exception.ApiError as ex:
23- LOG.exception(_('ApiError raised: %s'), str(ex), context=context)
24+ LOG.exception(_('ApiError raised: %s'), ex.args[0],
25+ context=context)
26 if ex.code:
27- return self._error(req, context, ex.code, str(ex))
28+ return self._error(req, context, ex.code, ex.args[0])
29 else:
30- return self._error(req, context, type(ex).__name__, str(ex))
31+ return self._error(req, context, type(ex).__name__, ex.args[0])
32 except Exception as ex:
33 extra = {'environment': req.environ}
34- LOG.exception(_('Unexpected error raised: %s'), str(ex),
35+ LOG.exception(_('Unexpected error raised: %s'), ex.args[0],
36 extra=extra, context=context)
37 return self._error(req,
38 context,
39@@ -347,7 +348,8 @@
40 '<Response><Errors><Error><Code>%s</Code>'
41 '<Message>%s</Message></Error></Errors>'
42 '<RequestID>%s</RequestID></Response>' %
43- (code, message, context.request_id))
44+ (utils.utf8(code), utils.utf8(message),
45+ utils.utf8(context.request_id)))
46 return resp
47
48