Use zaza.model.get_unit_public_address()

Replace the use of "unit.public_address" with
zaza.model.get_unit_public_address().

    AssertionError: {'host': '172.16.0.25', 'port': 3306, 'user': 'prom_exporter'} != {'host': None, 'port': 3306, 'user': 'prom_exporter'}
    - {'host': '172.16.0.25', 'port': 3306, 'user': 'prom_exporter'}
    ?          ^^^^^^^^^^^^^
    + {'host': None, 'port': 3306, 'user': 'prom_exporter'}

Related-Bug: openstack-charmers/zaza#472
This commit is contained in:
Felipe Reyes
2023-03-22 14:40:50 -03:00
parent ef62272bbf
commit 6fec7c31a4

View File

@@ -118,7 +118,7 @@ class PrometheusMySQLExporterTest(MySQLBaseTest):
self.assertEqual(
json_mysql_config,
{
"host": unit.public_address,
"host": zaza_model.get_unit_public_address(unit),
"port": 3306,
"user": "prom_exporter"
}