Merge lp:~adam-collard/charms/precise/swift-storage/lib-in-python-package into lp:~openstack-charmers-archive/charms/trusty/swift-storage/next

Proposed by Adam Collard
Status: Merged
Merged at revision: 72
Proposed branch: lp:~adam-collard/charms/precise/swift-storage/lib-in-python-package
Merge into: lp:~openstack-charmers-archive/charms/trusty/swift-storage/next
Diff against target: 130 lines (+13/-14)
9 files modified
.coveragerc (+1/-1)
Makefile (+3/-2)
charm-helpers-hooks.yaml (+1/-1)
hooks/swift_storage_hooks.py (+1/-1)
setup.cfg (+2/-2)
unit_tests/__init__.py (+0/-2)
unit_tests/test_swift_storage_context.py (+1/-1)
unit_tests/test_swift_storage_relations.py (+3/-3)
unit_tests/test_swift_storage_utils.py (+1/-1)
To merge this branch: bzr merge lp:~adam-collard/charms/precise/swift-storage/lib-in-python-package
Reviewer Review Type Date Requested Status
Geoff Teale (community) Approve
James Page Approve
Review via email: mp+265105@code.launchpad.net

Description of the change

With the addition of actions to the OpenStack charms, there's a need to share code between actions and hooks. This branch moves library code to a top-level ./lib/ and then symlinks that into ./hooks/lib, likewise for charm-helpers.

This should be a plain refactor with no change in behaviour, but laying the ground for an actions/lib symlink and an actions/charm-helpers symlink.

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

charm_lint_check #6353 swift-storage-next for adam-collard mp265105
    LINT OK: passed

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

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

charm_unit_test #5985 swift-storage-next for adam-collard mp265105
    UNIT OK: passed

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

Revision history for this message
James Page (james-page) :
review: Approve
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #5163 swift-storage-next for adam-collard mp265105
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/5163/

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

charm_lint_check #7867 swift-storage-next for adam-collard mp265105
    LINT OK: passed

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

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

charm_unit_test #7288 swift-storage-next for adam-collard mp265105
    UNIT OK: passed

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

Revision history for this message
Geoff Teale (tealeg) wrote :

+1 Looks good to me.

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

charm_amulet_test #5757 swift-storage-next for adam-collard mp265105
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/5757/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.coveragerc'
2--- .coveragerc 2013-07-19 20:44:37 +0000
3+++ .coveragerc 2015-08-11 08:10:53 +0000
4@@ -4,4 +4,4 @@
5 if __name__ == .__main__.:
6 include=
7 hooks/swift_storage_*
8-
9+ lib/swift_storage_*
10
11=== modified file 'Makefile' (properties changed: -x to +x)
12--- Makefile 2015-04-16 21:32:08 +0000
13+++ Makefile 2015-08-11 08:10:53 +0000
14@@ -2,8 +2,9 @@
15 PYTHON := /usr/bin/env python
16
17 lint:
18- @flake8 --exclude hooks/charmhelpers hooks
19- @flake8 --exclude hooks/charmhelpers unit_tests tests
20+ @flake8 lib
21+ @flake8 hooks
22+ @flake8 unit_tests tests
23 @charm proof
24
25 unit_test:
26
27=== modified file 'charm-helpers-hooks.yaml'
28--- charm-helpers-hooks.yaml 2015-07-31 13:11:32 +0000
29+++ charm-helpers-hooks.yaml 2015-08-11 08:10:53 +0000
30@@ -1,5 +1,5 @@
31 branch: lp:charm-helpers
32-destination: hooks/charmhelpers
33+destination: charmhelpers
34 include:
35 - core
36 - cli
37
38=== renamed directory 'hooks/charmhelpers' => 'charmhelpers'
39=== added file 'hooks/__init__.py'
40=== added symlink 'hooks/charmhelpers'
41=== target is u'../charmhelpers/'
42=== added symlink 'hooks/lib'
43=== target is u'../lib'
44=== modified file 'hooks/swift_storage_hooks.py'
45--- hooks/swift_storage_hooks.py 2015-01-12 13:24:00 +0000
46+++ hooks/swift_storage_hooks.py 2015-08-11 08:10:53 +0000
47@@ -3,7 +3,7 @@
48 import os
49 import sys
50
51-from swift_storage_utils import (
52+from lib.swift_storage_utils import (
53 PACKAGES,
54 RESTART_MAP,
55 SWIFT_SVCS,
56
57=== added directory 'lib'
58=== renamed file 'hooks/__init__.py' => 'lib/__init__.py'
59=== renamed file 'hooks/misc_utils.py' => 'lib/misc_utils.py'
60=== renamed file 'hooks/swift_storage_context.py' => 'lib/swift_storage_context.py'
61=== renamed file 'hooks/swift_storage_utils.py' => 'lib/swift_storage_utils.py'
62=== modified file 'setup.cfg'
63--- setup.cfg 2013-07-19 20:44:37 +0000
64+++ setup.cfg 2015-08-11 08:10:53 +0000
65@@ -1,6 +1,6 @@
66-[nosesetests]
67+[nosetests]
68 verbosity=2
69 with-coverage=1
70 cover-erase=1
71-cover-package=hooks
72+cover-package=lib,hooks.swift_storage_hooks
73
74
75=== modified file 'unit_tests/__init__.py'
76--- unit_tests/__init__.py 2013-07-19 20:44:37 +0000
77+++ unit_tests/__init__.py 2015-08-11 08:10:53 +0000
78@@ -1,2 +0,0 @@
79-import sys
80-sys.path.append('hooks')
81
82=== modified file 'unit_tests/test_swift_storage_context.py'
83--- unit_tests/test_swift_storage_context.py 2015-03-05 02:24:01 +0000
84+++ unit_tests/test_swift_storage_context.py 2015-08-11 08:10:53 +0000
85@@ -1,7 +1,7 @@
86 from mock import MagicMock
87 from test_utils import CharmTestCase, patch_open
88
89-import swift_storage_context as swift_context
90+import lib.swift_storage_context as swift_context
91
92
93 TO_PATCH = [
94
95=== modified file 'unit_tests/test_swift_storage_relations.py'
96--- unit_tests/test_swift_storage_relations.py 2015-03-05 02:24:01 +0000
97+++ unit_tests/test_swift_storage_relations.py 2015-08-11 08:10:53 +0000
98@@ -2,16 +2,16 @@
99
100 from test_utils import CharmTestCase, patch_open
101
102-import swift_storage_utils as utils
103+import lib.swift_storage_utils as utils
104
105 _reg = utils.register_configs
106 utils.register_configs = MagicMock()
107
108-import swift_storage_hooks as hooks
109+import hooks.swift_storage_hooks as hooks
110
111 utils.register_configs = _reg
112
113-from swift_storage_utils import PACKAGES
114+from lib.swift_storage_utils import PACKAGES
115
116 TO_PATCH = [
117 'CONFIGS',
118
119=== modified file 'unit_tests/test_swift_storage_utils.py'
120--- unit_tests/test_swift_storage_utils.py 2015-04-02 18:56:27 +0000
121+++ unit_tests/test_swift_storage_utils.py 2015-08-11 08:10:53 +0000
122@@ -4,7 +4,7 @@
123 from mock import call, patch, MagicMock
124 from test_utils import CharmTestCase, patch_open
125
126-import swift_storage_utils as swift_utils
127+import lib.swift_storage_utils as swift_utils
128
129
130 TO_PATCH = [

Subscribers

People subscribed via source and target branches