Ensure identical types for comparing port number/string
Fix an oversight and regression in commit c97fced7947e
("Close previously opened ports on port config change").
The comparison between an integer and a string (returned
by .split()) is always different and thus when upgrading
the charm 'port 80' is closed.
Make sure the types are set to str. Right now it should
only be needed for port and not opened_port_number; but
let's future proof both sides of the comparison.
(Update: using str() vs int() as apparently int() might
fail but str() should always work no matter what it got;
thanks, Alex Kavanagh!)
Before:
$ juju run --unit ceph-radosgw/0 opened-ports
80/tcp
$ juju upgrade-charm --path . ceph-radosgw
$ juju run --unit ceph-radosgw/0 opened-ports
$
@ log:
2021-04-05 15:08:04 INFO juju-log Closed port 80 in favor of port 80
$ python3 -q
>>> x=80
>>> y='80/tcp'
>>> z=y.split('/')[0]
>>> z
'80'
>>> x
80
>>> x != z
True
>>> x=str(x)
>>> x != z
False
After:
$ juju run --unit ceph-radosgw/1 opened-ports
80/tcp
$ juju upgrade-charm --path . ceph-radosgw
$ juju run --unit ceph-radosgw/1 opened-ports
80/tcp
Signed-off-by: Mauricio Faria de Oliveira <email address hidden>
Change-Id: I2bcdfec1459ea45d8f57b850b7fd935c360cc7c1
The 'hirsute' key in c-h/core/host_factory/ubuntu.py:
UBUNTU_RELEASES had been missed out, and is needed for
hirsute support in many of the charms. This sync is to
add just that key. See also [1]
Remove endpoint settings without service prefix on config-changed
Older charms pass endpoint data with the legacy method, without
service prefix (e.g., `admin_url` instead of `swift_admin_url`.)
After charm upgrade the endpoint data is set in the new method,
with service prefix, however the legacy endpoint data is still
there as it has not been removed.
The keystone charms checks first for the legacy method, and if
it's found, the new method is ignored and any endpoint changes
made on the new charm (e.g., port) are not implemented.
So make sure to remove the legacy endpoint settings from the
relation, so the keystone charm can pick up eg, port changes,
and even set up the s3 endpoint after charm upgrades between
the legacy method and the new method.
21.04 libraries freeze for charms on master branch
* charm-helpers sync for classic charms
* build.lock file for reactive charms
* ensure tox.ini is from release-tools
* ensure requirements.txt files are from release-tools
* On reactive charms:
- ensure stable/21.04 branch for charms.openstack
- ensure stable/21.04 branch for charm-helpers
$ juju run --unit ceph-radosgw/1 'opened-ports'
33335/tcp
$ juju status ceph-radosgw
...
Unit Workload Agent Machine Public address Ports
Message
ceph-radosgw/1* blocked idle 3 10.5.2.210 33335/tcp
Missing relations: mon
@ unit log
2021-03-24 13:20:51 INFO juju-log Closed port 80 in favor of port 33335
2021-03-24 13:20:51 INFO juju-log Closed port 1111 in favor of port 33335
2021-03-24 13:20:51 INFO juju-log Closed port 1234 in favor of port 33335
2021-03-24 13:20:51 INFO juju-log Closed port 2222 in favor of port 33335
2021-03-24 13:20:52 INFO juju-log Closed port 3333 in favor of port 33335
2021-03-24 13:20:52 INFO juju-log Closed port 33331 in favor of port 33335
2021-03-24 13:20:52 INFO juju-log Closed port 33332 in favor of port 33335
2021-03-24 13:20:52 INFO juju-log Closed port 33334 in favor of port 33335