Merge lp://qastaging/~xfactor973/charms/trusty/ceph/erasure_actions into lp://qastaging/~openstack-charmers-archive/charms/trusty/ceph/next

Proposed by Chris Holcombe
Status: Merged
Merged at revision: 138
Proposed branch: lp://qastaging/~xfactor973/charms/trusty/ceph/erasure_actions
Merge into: lp://qastaging/~openstack-charmers-archive/charms/trusty/ceph/next
Diff against target: 1893 lines (+1247/-134)
29 files modified
.bzrignore (+1/-0)
Makefile (+1/-1)
actions.yaml (+175/-0)
actions/__init__.py (+3/-0)
actions/ceph_ops.py (+103/-0)
actions/create-erasure-profile (+89/-0)
actions/create-pool (+38/-0)
actions/delete-erasure-profile (+24/-0)
actions/delete-pool (+28/-0)
actions/get-erasure-profile (+18/-0)
actions/list-erasure-profiles (+22/-0)
actions/list-pools (+17/-0)
actions/pool-get (+19/-0)
actions/pool-set (+23/-0)
actions/pool-statistics (+15/-0)
actions/remove-pool-snapshot (+19/-0)
actions/rename-pool (+16/-0)
actions/set-pool-max-bytes (+16/-0)
actions/snapshot-pool (+18/-0)
hooks/ceph_broker.py (+238/-42)
hooks/charmhelpers/contrib/network/ip.py (+15/-0)
hooks/charmhelpers/contrib/storage/linux/ceph.py (+38/-12)
hooks/charmhelpers/core/host.py (+41/-26)
hooks/charmhelpers/fetch/giturl.py (+3/-1)
tests/charmhelpers/contrib/openstack/amulet/deployment.py (+3/-2)
tox.ini (+1/-1)
unit_tests/test_ceph_broker.py (+46/-48)
unit_tests/test_ceph_ops.py (+217/-0)
unit_tests/test_status.py (+0/-1)
To merge this branch: bzr merge lp://qastaging/~xfactor973/charms/trusty/ceph/erasure_actions
Reviewer Review Type Date Requested Status
James Page Needs Fixing
Review via email: mp+280579@code.qastaging.launchpad.net

Description of the change

This will add erasure pool actions to the ceph charm. So far manual tests have been run. They turned up a few bugs in my charmhelpers code so I'll submit a separate merge proposal for that.

To post a comment you must log in.
126. By Chris Holcombe

lint errors

127. By Chris Holcombe

Missed a few typos

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

charm_unit_test #14400 ceph-next for xfactor973 mp280579
    UNIT FAIL: unit-test failed

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

Full unit test output: http://paste.ubuntu.com/14026795/
Build: http://10.245.162.77:8080/job/charm_unit_test/14400/

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

charm_lint_check #15436 ceph-next for xfactor973 mp280579
    LINT OK: passed

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

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

charm_unit_test #14404 ceph-next for xfactor973 mp280579
    UNIT FAIL: unit-test failed

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

Full unit test output: http://paste.ubuntu.com/14027544/
Build: http://10.245.162.77:8080/job/charm_unit_test/14404/

Revision history for this message
James Page (james-page) wrote :

Hi Chris

Working through this update now; however unit test failure:

======================================================================
FAIL: test_process_requests_invalid_api_version (unit_tests.test_ceph_broker.CephBrokerTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/jamespage/lib/os-charms/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "/home/jamespage/src/charms/landing/ceph/unit_tests/test_ceph_broker.py", line 34, in test_process_requests_invalid_api_version
    'stderr': 'Missing or invalid api version (2)'})
AssertionError: {u'exit-code': 0} != {'exit-code': 1, 'stderr': 'Missing or invalid api version (2)'}
- {u'exit-code': 0}
+ {'exit-code': 1, 'stderr': 'Missing or invalid api version (2)'}

Revision history for this message
James Page (james-page) wrote :

I think we also need some new unit tests to cover the v2 api for ceph_broker please.

review: Needs Fixing
Revision history for this message
James Page (james-page) wrote :

actions.yaml:

Quite a bit of trailing whitespace - please tidy.

set-pool-max-bytes:
  description: Set pool quotas for the maximum number of bytes.
  params:
    max:
      type: integer
      description: The name of the pool

^^ needs correctiing

review: Needs Fixing
Revision history for this message
James Page (james-page) wrote :

actions.yaml:

I'd suggest that you provide enums for strings where only a defined set of values is supported - see:

https://jujucharms.com/docs/1.25/authors-charm-actions

This is a feature missing from config options, but we should use them for actions.

Revision history for this message
James Page (james-page) wrote :

providing functional tests for the actions is going to be hard due to the requirements for underlying storage devices, so that's not required for this merge.

However, it would be nice to have some unit tests for actions please!

review: Needs Fixing
Revision history for this message
James Page (james-page) wrote :

You also need to add 'actions' to the list of lint targets in the Makefile:

actions/__init__.py:3:25: W292 no newline at end of file
actions/ceph_ops.py:7:1: F401 'Hooks' imported but unused
actions/ceph_ops.py:8:80: E501 line too long (113 > 79 characters)
actions/ceph_ops.py:11:1: E302 expected 2 blank lines, found 1
actions/ceph_ops.py:81:80: E501 line too long (90 > 79 characters)
actions/ceph_ops.py:97:1: F811 redefinition of unused 'snapshot_pool' from line 8
actions/ceph_ops.py:100:80: E501 line too long (83 > 79 characters)

review: Needs Fixing
Revision history for this message
James Page (james-page) wrote :

(and to tox.ini as well)

Revision history for this message
James Page (james-page) wrote :

Style comment on action parameters - I'd stick with either - or _ for keys - preferably '-' as I think this looks nicer.

Revision history for this message
James Page (james-page) wrote :

sys.exit(1) is probably working, but please use action_fail to indicate some sort of action failure - this is propagated back in full via juju

128. By Chris Holcombe

Add actions to lint. Change actions.yaml to use enum and also change underscores to dashes. Log action_fail in addition to exiting -1. Merge v2 requests with v1 requests since this does not break backwards compatibility. Add unit tests. Modify tox.ini to include actions. .

129. By Chris Holcombe

Adding a unit test file for ceph_ops

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

charm_lint_check #17860 ceph-next for xfactor973 mp280579
    LINT FAIL: lint-test failed

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

Full lint test output: http://paste.ubuntu.com/14591583/
Build: http://10.245.162.77:8080/job/charm_lint_check/17860/

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

charm_unit_test #16691 ceph-next for xfactor973 mp280579
    UNIT FAIL: unit-test failed

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

Full unit test output: http://paste.ubuntu.com/14591584/
Build: http://10.245.162.77:8080/job/charm_unit_test/16691/

130. By Chris Holcombe

Clean up lint warnings. Also added a few more mock unit tests

Revision history for this message
Chris Holcombe (xfactor973) wrote :

@jamespage this is ready for another look. I've cleaned up the lint warnings and added a bunch more unit tests.

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

charm_lint_check #17871 ceph-next for xfactor973 mp280579
    LINT FAIL: lint-test failed

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

Full lint test output: http://paste.ubuntu.com/14593196/
Build: http://10.245.162.77:8080/job/charm_lint_check/17871/

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

charm_unit_test #16702 ceph-next for xfactor973 mp280579
    UNIT FAIL: unit-test failed

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

Full unit test output: http://paste.ubuntu.com/14593197/
Build: http://10.245.162.77:8080/job/charm_unit_test/16702/

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

charm_amulet_test #8949 ceph-next for xfactor973 mp280579
    AMULET OK: passed

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

Revision history for this message
James Page (james-page) wrote :

Hi Chris

Working through the review; however I have a number of merge conflicts - can you rebase/repush this branch pls.

review: Needs Fixing
Revision history for this message
James Page (james-page) wrote :

These tests are not executed under tox:

======================================================================
ERROR: unit_tests.test_ceph_broker.test_process_requests_create_pool_exists
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1297, in patched
    arg = patching.__enter__()
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1369, in __enter__
    original, local = self.get_original()
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1343, in get_original
    "%s does not have the attribute %r" % (target, name)
AttributeError: <module 'ceph_broker' from 'hooks/ceph_broker.pyc'> does not have the attribute 'create_pool'

======================================================================
ERROR: unit_tests.test_ceph_broker.test_process_requests_create_pool_rid
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1297, in patched
    arg = patching.__enter__()
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1369, in __enter__
    original, local = self.get_original()
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1343, in get_original
    "%s does not have the attribute %r" % (target, name)
AttributeError: <module 'ceph_broker' from 'hooks/ceph_broker.pyc'> does not have the attribute 'create_pool'

======================================================================
ERROR: unit_tests.test_ceph_broker.test_process_requests_invalid_api_rid
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
TypeError: test_process_requests_invalid_api_rid() takes exactly 2 arguments (1 given)

----------------------------------------------------------------------

review: Needs Fixing
131. By Chris Holcombe

Merge upstream and resolve conflicts

132. By Chris Holcombe

Patching up the other unit tests to passing status

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

charm_lint_check #17961 ceph-next for xfactor973 mp280579
    LINT FAIL: lint-test failed

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

Full lint test output: http://paste.ubuntu.com/14602150/
Build: http://10.245.162.77:8080/job/charm_lint_check/17961/

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

charm_unit_test #16783 ceph-next for xfactor973 mp280579
    UNIT OK: passed

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

133. By Chris Holcombe

Clean up another lint error

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

charm_amulet_test #8984 ceph-next for xfactor973 mp280579
    AMULET FAIL: amulet-test failed

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

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

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

charm_unit_test #16784 ceph-next for xfactor973 mp280579
    UNIT OK: passed

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

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

charm_lint_check #17962 ceph-next for xfactor973 mp280579
    LINT OK: passed

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

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

charm_amulet_test #8985 ceph-next for xfactor973 mp280579
    AMULET FAIL: amulet-test failed

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

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

Revision history for this message
Chris Holcombe (xfactor973) wrote :

@jamespage I think this is ready for another look.

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

charm_lint_check #211 ceph-next for xfactor973 mp280579
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/211/

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

charm_unit_test #196 ceph-next for xfactor973 mp280579
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/196/

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

charm_amulet_test #97 ceph-next for xfactor973 mp280579
    AMULET FAIL: amulet-test failed

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

Full amulet test output: http://paste.ubuntu.com/15016269/
Build: http://10.245.162.36:8080/job/charm_amulet_test/97/

134. By Chris Holcombe

Used a list as an integer. I meant to use the size of the list

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

charm_lint_check #394 ceph-next for xfactor973 mp280579
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/394/

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

charm_unit_test #314 ceph-next for xfactor973 mp280579
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/314/

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

charm_amulet_test #165 ceph-next for xfactor973 mp280579
    AMULET OK: passed

Build: http://10.245.162.36:8080/job/charm_amulet_test/165/

Revision history for this message
James Page (james-page) wrote :

Only minor niggles now; sooo close....

review: Needs Fixing
Revision history for this message
James Page (james-page) wrote :

One thing for follow-up after this lands - I think this would be good to cover with actions testing in the amulet tests - ChrisM added some for pause/resume so there is a fairly easy example to follow.

Revision history for this message
James Page (james-page) wrote :

I then took a look at past /me's comments -

https://code.launchpad.net/~xfactor973/charms/trusty/ceph/erasure_actions/+merge/280579/comments/714167

I don't think this has been addressed; we should be using action_* to handle failures so that the action fetch command actually gets useful output.

review: Needs Fixing
Revision history for this message
James Page (james-page) :
review: Needs Fixing
135. By Chris Holcombe

Fix up the niggles and provide feedback to the action user as to why something failed

136. By Chris Holcombe

Merge upstream and resolve conflicts with actions and actions.yaml

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

charm_unit_test #810 ceph-next for xfactor973 mp280579
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/810/

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

charm_lint_check #910 ceph-next for xfactor973 mp280579
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/910/

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

charm_amulet_test #355 ceph-next for xfactor973 mp280579
    AMULET OK: passed

Build: http://10.245.162.36:8080/job/charm_amulet_test/355/

Revision history for this message
James Page (james-page) wrote :

OK - action fails look ok

Two more things:

1) Please use /usr/bin/python for the action #!

2) there is a charmhelpers change in this branch that's not in charm-helpers - can you sort that out please :-)

review: Needs Fixing
137. By Chris Holcombe

Change /usr/bin/python2.7 to /usr/bin/python

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

charm_unit_test #821 ceph-next for xfactor973 mp280579
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/821/

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

charm_lint_check #921 ceph-next for xfactor973 mp280579
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/921/

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

charm_amulet_test #365 ceph-next for xfactor973 mp280579
    AMULET OK: passed

Build: http://10.245.162.36:8080/job/charm_amulet_test/365/

Revision history for this message
James Page (james-page) wrote :

charm helpers change landed - please resync!

138. By Chris Holcombe

charmhelpers sync

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

charm_lint_check #1168 ceph-next for xfactor973 mp280579
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/1168/

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

charm_unit_test #1004 ceph-next for xfactor973 mp280579
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/1004/

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

charm_amulet_test #448 ceph-next for xfactor973 mp280579
    AMULET FAIL: amulet-test failed

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

Full amulet test output: http://paste.ubuntu.com/15172006/
Build: http://10.245.162.36:8080/job/charm_amulet_test/448/

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

charm_amulet_test #463 ceph-next for xfactor973 mp280579
    AMULET FAIL: amulet-test failed

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

Full amulet test output: http://paste.ubuntu.com/15175249/
Build: http://10.245.162.36:8080/job/charm_amulet_test/463/

Revision history for this message
Ryan Beisner (1chb1n) wrote :

Please rebase your branch and push it back to get updated tests. Thank you.

Revision history for this message
Chris Holcombe (xfactor973) wrote :

Done! Thanks :)

On 02/23/2016 07:31 AM, Ryan Beisner wrote:
> Please rebase your branch and push it back to get updated tests. Thank you.
>

139. By Chris Holcombe

Merge upstream

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

charm_lint_check #1297 ceph-next for xfactor973 mp280579
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/1297/

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

charm_unit_test #1074 ceph-next for xfactor973 mp280579
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/1074/

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

charm_amulet_test #476 ceph-next for xfactor973 mp280579
    AMULET OK: passed

Build: http://10.245.162.36:8080/job/charm_amulet_test/476/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches