Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update get_ceph_expected_pools for Pike and Luminous #32

Closed
wants to merge 12 commits into from

Conversation

ryan-beisner
Copy link
Contributor

No description provided.

Ryan Beisner and others added 3 commits October 27, 2017 13:30
A few changes to just bring charm-helpers ceph utils into Py3 land
as well as Py2.

Plus, recent PEP8 is more stringent, so just updates to make PEP8
happy.

Part of the migrating OpenStack charms to Python3 work.
….2 (juju#33)

* open/close_port supports ICMP protocol; drive-by fix for network_get so it runs with Juju 2.0.2

* Remove naked except from _port_op method
Copy link
Collaborator

@ajkavanagh ajkavanagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the code needs to be re-ordered for clarify, plus there's no test for the changes ... but perhaps there are no tests for the existing code either?

]
elif (self._get_openstack_release() >= self.trusty_kilo and
self._get_openstack_release() <= self.zesty_ocata):
# Kilo through Ocata
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to stare at this for a while to understand it.

The 2nd elif can be written a little more nicely as:

    elif self.trust_kilo <= self._get_openstack_release() <= self.zesty_ocata:
        ...

But now the code looks a little confusing. I'd like to suggest switching the order of the if statements so that they go in order of OpenStack releases. e.g. start with the juno or earlier, then pick off the inbetween ones and finally have the latest so that it reads chronologically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed, the test helper code itself generally doesn't have unit test coverage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified and re-ordered per recommendations - thank you. See updated PR.

javacruft and others added 4 commits November 5, 2017 02:56
Ensure that under Python 3, the rended template content is encoded
before writing to the target file.
Ensure compatibility with Python 3 by using six.iteritems.
Python 3 makes no guarantee about iteration order in dicts;
ensure that an OrderedDict is used instead to ensure that the
ordering of haproxy backend units is consistent between hook
executions, avoiding restarts of haproxy due to changes in
the ordering of units.
@ryan-beisner ryan-beisner changed the title [WIP] Update get_ceph_expected_pools for Pike and Luminous Update get_ceph_expected_pools for Pike and Luminous Nov 5, 2017
ajkavanagh
ajkavanagh previously approved these changes Nov 5, 2017
@ajkavanagh
Copy link
Collaborator

These changes look great. I'm not sure if it's still WIP, so I've not merged it.

@ryan-beisner
Copy link
Contributor Author

@ajkavanagh Ready to squash/merge from my view. Thanks again.

@ryan-beisner
Copy link
Contributor Author

Actually, I've done something unsavory with a git rebase here, and have raised a separate clean review.

@ryan-beisner ryan-beisner deleted the pike-amulet-ceph2 branch November 5, 2017 19:28
@ryan-beisner
Copy link
Contributor Author

Please see fresh PR at:

#40

openstack-gerrit pushed a commit to openstack/charm-cinder-backup that referenced this pull request Dec 8, 2017
This change requires the following charm-helpers change
to land first:

 - juju/charm-helpers#32

Change-Id: Iae88b2c11fe9ddcc176075f54a8c075d2dc3ba4c
openstack-gerrit pushed a commit to openstack/charm-cinder-ceph that referenced this pull request Dec 8, 2017
Also sync charm-helpers

This change requires the following charm-helpers change
to land first:

 - juju/charm-helpers#32

Change-Id: I2c33e25e14ad49d65f5fc7eb000830086cf829c1
openstack-gerrit pushed a commit to openstack-archive/charm-ceph that referenced this pull request Dec 12, 2017
This change requires the following charm-helpers change
to land first:

- juju/charm-helpers#32

Change-Id: I7c1c2399cb38fd48139f3d42854442796e0d3a3b
rayrobert398 added a commit to rayrobert398/swift-charm-cinder-backup that referenced this pull request Oct 3, 2022
This change requires the following charm-helpers change
to land first:

 - juju/charm-helpers#32

Change-Id: Iae88b2c11fe9ddcc176075f54a8c075d2dc3ba4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants