Mentions légales du service

Skip to content

Dev/g5k dictectomy

SIMONIN Matthieu requested to merge msimonin/enoslib:dev/g5k_dictectomy into master

This replaces our abuse of Dicts in the g5k provider by structured objects.

There's no external API changes (provider.init still return roles and networks as before). But G5k provider no expose two attributes provider.hosts and provider.networks being a list of G5kHost et G5kNetwork which wraps the corresponding API object (see python-grid5000) and offer some convenient methods to the experimenter.

For instance

provider = G5k(conf)
roles, networks = provider.init()
# roles and networks are the legacy returned value, usable by enoslib to act on in a generic manner (e.g services...)

# access the concrete G5K hosts of the experience
g5k_hosts = provider.hosts  

# give back the roles
g5k_hosts[0].roles

# give the ssh-able address
g5k_hosts[0].ssh_address

# give all the property available in the API
g5k_hosts[0].apinode

# give the attached network (G5kNetwork)
g5k_hosts[0].primary_network

# give the roles of the network
g5k_hosts[0].primary_network

# give the vlan_id (if any) of the network
g5k_hosts[0].primary_network.vlan_id

# give all the hosts in this network
g5k_hosts[0].primary_network.hosts

The same apply on the network list

Edited by SIMONIN Matthieu

Merge request reports