Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 8b9a760d authored by DE-MOURA-DONASSOLO Bruno's avatar DE-MOURA-DONASSOLO Bruno
Browse files

Fixes.

sync_network_info: only for Host. Avoid errors with iotlab sensors
monitoring: get the real IP address not the IPv6Interface object.
Improved functionnal test
parent 97ce4f41
No related branches found
No related tags found
No related merge requests found
......@@ -811,6 +811,9 @@ def sync_network_info(roles: Roles, networks: Networks) -> Roles:
facts = json.load(f)
for hosts in _roles.values():
for host in hosts:
# only sync if host is really a Host (not a Sensor for example)
if (not isinstance(host, Host)):
continue
host_facts = facts[host.alias]
host.sync_from_ansible(networks, host_facts)
......
......@@ -41,7 +41,7 @@ def _get_address(host: Host, networks: Optional[List[Network]]) -> str:
f"Cannot determine single IP address."
f"Options: {address} Host: {host}, Networks: {networks}"
)
return str(address[0])
return str(address[0].ip.ip)
class TIGMonitoring(Service):
......
......@@ -2,7 +2,7 @@ import logging
import os
from enoslib.api import sync_network_info
from enoslib.service import TIGMonitoring
from enoslib.service import TIGMonitoring, TPGMonitoring
from enoslib.infra.enos_static.provider import Static
from enoslib.infra.enos_static.configuration import Configuration
......@@ -39,8 +39,15 @@ roles, networks = provider.init()
roles = sync_network_info(roles, networks)
m = TIGMonitoring(collector=roles["control"][0], agent=roles["control"], ui=roles["control"][0])
m.deploy()
m.backup()
# testing TIG stack
m_tig = TIGMonitoring(collector=roles["control"][0], agent=roles["control"], ui=roles["control"][0])
m_tig.deploy()
m_tig.backup()
# test whether the backup is ok...
m.destroy()
m_tig.destroy()
# testing TGP stack
m_tpg = TPGMonitoring(collector=roles["control"][0], agent=roles["control"], ui=roles["control"][0], networks=networks)
m_tpg.deploy()
m_tpg.backup()
m_tpg.destroy()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment