Merge lp:~nobuto/charms/trusty/nova-cloud-controller/fix-catch-error into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Nobuto Murata
Status: Merged
Merged at revision: 187
Proposed branch: lp:~nobuto/charms/trusty/nova-cloud-controller/fix-catch-error
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 12 lines (+1/-1)
1 file modified
hooks/nova_cc_hooks.py (+1/-1)
To merge this branch: bzr merge lp:~nobuto/charms/trusty/nova-cloud-controller/fix-catch-error
Reviewer Review Type Date Requested Status
Edward Hope-Morley Approve
Review via email: mp+269064@code.launchpad.net

Description of the change

fix catch error of "No such file or directory" with python2, LP: #1484605

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #8703 nova-cloud-controller-next for nobuto mp269064
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/8703/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #8037 nova-cloud-controller-next for nobuto mp269064
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/8037/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #6025 nova-cloud-controller-next for nobuto mp269064
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 124
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/12193173/
Build: http://10.245.162.77:8080/job/charm_amulet_test/6025/

Revision history for this message
Felipe Reyes (freyes) wrote :

Hi Nobuto,

Thanks for your MP, this looks good to me and the unit tests run OK, and effectively the exception that should be catched in py2.x is OSError[0]. I wonder what I was thinking when I wrote IOError :\

Amulet tests failed, I'll ask beisner to rerun this MP, there is no way this change break them.

Best,

[0] >>> os.remove('/tmp/asdfg')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 2] No such file or directory: '/tmp/asdfg'

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #6149 nova-cloud-controller-next for nobuto mp269064
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/12239081/
Build: http://10.245.162.77:8080/job/charm_amulet_test/6149/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #6150 nova-cloud-controller-next for nobuto mp269064
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 124
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/12239792/
Build: http://10.245.162.77:8080/job/charm_amulet_test/6150/

Revision history for this message
Edward Hope-Morley (hopem) wrote :

Both IOError and OSError map to FileNotFound depending on whether it is stdlib or os since it is actually a wrapper for ENOENT - https://docs.python.org/3/library/exceptions.html#FileNotFoundError.

So LGTM +1 but non-os calls will need IOError -> FilNotFound.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/nova_cc_hooks.py'
2--- hooks/nova_cc_hooks.py 2015-07-24 12:29:29 +0000
3+++ hooks/nova_cc_hooks.py 2015-08-25 13:54:10 +0000
4@@ -134,7 +134,7 @@
5 FileNotFoundError
6 except NameError:
7 # python3 compatibility
8- FileNotFoundError = IOError
9+ FileNotFoundError = OSError
10
11 hooks = Hooks()
12 CONFIGS = register_configs()

Subscribers

People subscribed via source and target branches