Commit Graph

19 Commits

Author SHA1 Message Date
Alex Kavanagh f6cd0d6bf3 Fix yaml safe_load and allow unittests on py35
* Change yaml.load() -> yaml.safe_load()
 * Pin cffi to 1.14.6 for py35

Change-Id: I623ce5f636e36a121d22763e591d618d26db4b07
2021-10-14 14:32:00 +01:00
Alex Kavanagh e869f021cb Sync libraries & common files prior to freeze
* charm-helpers sync for classic charms
* charms.ceph sync for ceph charms
* rebuild for reactive charms
* sync tox.ini files as needed
* sync requirements.txt files to sync to standard

Change-Id: I452af2fa5a833c435b913571fd059282bbe0a1a6
2020-09-27 19:26:04 +01:00
Drew Freiberger 0ce1ee67f8 set-weight/remove-devices actions are leader-only
When running set-weight and remove-devices actions, they must be run
on the leader of the swift-proxy cluster.  Lacking this validation,
the ring builder file on a non-leader would get updated, but the
balance_rings action would fail, and the changes to the ring files
would not propogate to the remainder of the swift cluster.

Change-Id: I9134eb88b16e5ffe18f16ce30e03e469027b6670
Closes-Bug: 1882250
2020-06-10 08:03:37 -05:00
Liam Young ab8b60a21c When resuming, exclude haproxy
When resuming services exclude those managed by hacluster, in
this case haproxy. If pacemaker lacks quorum it may shut haproxy
down which will cause this charm to error.

Charmhelper sync included to bring in required
get_managed_services_and_ports method.

Change-Id: I85c380a2cffcd18031a32b6e3eb422aa5ff14994
2020-01-27 19:19:07 +00:00
Corey Bryant 1b47612f87 Drop support of swauth for Train and later
swauth is no longer maintained as of OpenStack Train [1] so we
need to stop supporting it for OpenStack Train and later.

[1] https://opendev.org/x/swauth

Closes-Bug: #1851394
Change-Id: Ic2345427951a311477d6808077fb18b248036b82
2020-01-07 15:03:08 -05:00
Corey Bryant 5f3735f884 py3: Switch packages to Python 3 for train and later
Switch package install to Python 3 for OpenStack Train and later.

When upgrading, remove any python-* packages that were explicitly
installated and then autoremove --purge any dependencies that are
no longer required.

This patch also includes the following related changes:
  * Use the common files package, swift, rather than python-swift
    as the package name when determining releases.
  * Drop the python2 shebang from manager.py in favor of specifying
    the interpreter on the subprocess call. The python interpreter
    version must match the python version of the OpenStack payload
    due to the swift library imports.
  * Enable the cPickle import in manager.py for Python 3
    (C-optimized module name is _pickle), and fix 'result'
    variable that is a set type but should be a dict type.

Change-Id: Ia3fdbf2020137bcf39039478ee3606717d3d6e20
Closes-Bug: #1841184
2019-10-10 06:51:20 +00:00
Tytus Kurek f9a02a3f58 Dispersion report
This patchset adds a template for the 'dispersion.conf' file which is
used for swift cluster health monitoring.

Change-Id: I348ded9f94f2bcb7a680b2c2280ff163cde65c46
Closes-Bug: 1328064
2019-07-01 09:24:10 +00:00
Tytus Kurek 3809df73fb Add 'set-weight' action.
This patchset adds the 'set-weight' action which can be used to set
weight of device(s) based on the search pattern.

Change-Id: I6bbc71f66d948e97d2dd6a5174dedb3212503a3f
Closes-Bug: 1821697
2019-06-18 10:43:44 +00:00
Levente Tamas 20b420ac69 Add 'remove-devices' action.
This patchset adds the 'remove-devices' action which can be used remove
devices from rings based on search patterns.

Change-Id: I1380193b27cc4f385f156af8d63c5594dfea9cfa
Co-Authored-By: Tytus Kurek <tytus.kurek@canonical.com>
Closes-Bug: 1822058
2019-04-12 13:04:58 +02:00
Alex Kavanagh 4336b8d644 Convert charm to Python 3 only
* Needed to add a swift_manager/manager.py file which uses the payload
  software python modules to perform certain functions on behalf of the
  charm.  These were part of the main charm, which couldn't be retained
  in the charm due to the charm changing to Py3.
* Changed to absolute imports using the charm root as the root for all
  charm modules.
* The py2 target in tox.ini is used to test the swift_manager/manager.py
  file only.
* The .testr.conf file has been migrated to .stestr.conf

Change-Id: If37a393aa6ed27651b04810aa0bbf69eda37d7b4
2017-12-06 14:20:25 +00:00
Jill Rouleau dcec924d47 Add an action to report utilization
Using swift-recon -d, report disk-utilization in GB.

Change-Id: I02f9b85106046fc038a66c7059c23c8a89fd32b1
Closes-Bug: 1720258
2017-11-03 15:15:36 -07:00
Chris MacNaughton ce3f15310e Implement swauth
This change implements the alternative authentication system,
swauth in addition to adding an action to add users to swauth

Change-Id: Ib752cd3a2a58f6c8cb06119c6be595cfc07ddc9f
2016-09-23 09:12:43 -04:00
James Page f48ecdbe0d Re-license charm as Apache-2.0
All contributions to this charm where made under Canonical
copyright; switch to Apache-2.0 license as agreed so we
can move forward with official project status.

Change-Id: I78e8d98d51c7ff28baf1c8421d093fbefd65ae7d
2016-07-01 18:12:11 +01:00
Alex Kavanagh d009a254f1 Enhanced pause/resume for maintenance mode
The existing pause/resume has been enhanced by adding more robust service
checks and hooking into the pause/resume functionality in the charmhelpers
library.

Change-Id: Ia487499ec4d8e4f41ec985eac02d97e085a06e2c
2016-04-11 16:28:51 +00:00
Corey Bryant 93ea05a733 Call assess_status() in pause/resume actions and update is_paused 2015-10-13 08:59:52 -04:00
Corey Bryant 744d05a142 Drop status_set() from pause_resume actions 2015-10-13 08:09:14 -04:00
David Ames 75e2ba3c80 Action managed upgrade 2015-09-23 09:28:19 -07:00
Adam Collard 245671d828 Add missing symlinks in actions too 2015-09-07 18:40:17 +01:00
Adam Collard 57a90e72ac Add pause and resume actions with unit tests 2015-09-07 16:55:10 +01:00