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 declaremockin 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: I69e03a14ab370bd6870e4325627e7be86fe2a53f
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Overview
This interface layer handles the communication with MySQL via the
mysql-sharedinterface protocol.Usage
Requires
The interface layer will set the following states, as appropriate:
{relation_name}.connectedThe relation is established, but MySQL has not been provided the database information.{relation_name}.availableMySQL is ready for use. You can get the base connection information via the following methods:allowed_units()database()db_host()hostname()username()password(){relation_name}.available.access_networkMySQL access network is ready for use. You can get this optional connection information via the following method:access_network(){relation_name}.available.sslMySQL ssl data is ready for use. You can get this optional connection information via the following methods:ssl_ca()ssl_cert()ssl_key()For example:
In Juju 2.0 environments, the interface will automatically determine the network space binding on the local unit to present to the remote mysql-shared service based on the name of the relation. In older Juju versions, the private-address of the unit will be used instead. This can be overridden using the hostname parameter of the configure method.
Provides
The interface layer will set the following states, as appropriate:
{relation_name}.connectedThe relation is established, but the client has not provided the database information yet.{relation_name}.availableThe requested information is complete. The DB, user and hostname can be created.set_db_connection_info()For example:
The interface will automatically determine the network space binding on the local unit to present to the remote mysql-shared client based on the name of the relation. This can be overridden using the db_host parameter of the set_db_connection_info method.