Commit Graph

4 Commits

Author SHA1 Message Date
Hervé Beraud 50417cdb32 Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Note that https://github.com/openstack/charms.openstack is used during tests
and he need `mock`, unfortunatelly it doesn't declare `mock` in its
requirements so it retrieve mock from other charm project (cross dependency).
So we depend on charms.openstack first and when
Ib1ed5b598a52375e29e247db9ab4786df5b6d142 will be merged then CI
will pass without errors.

Depends-On: Ib1ed5b598a52375e29e247db9ab4786df5b6d142
Change-Id: I8757d430ab233f4a21d1d599f1a7a9a0dc68d7ef
2021-12-15 11:45:01 +00:00
Tytus Kurek 44df5db97d Swift Global Cluster
This patchset adds a support for Swift Global Cluster feature as
described at:

https://docs.openstack.org/swift/latest/overview_global_cluster.html

It allows specifying affinity settings as parrt of the deployment.
Moreover, the master - slave relation is introduced for the purpose of
rings distribution across proxy nodes participating in the Swift Global
Cluster.

Change-Id: I406445493e2226aa5ae40a09c9053ac8633a46e9
Closes-Bug: 1815879
Depends-On: I11b6c7802e5bfbd61b06e4d11c65804a165781b6
2019-12-16 14:51:56 +00: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
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