lpouillo / vm5k

A Python module to help you to manage virtual machines on the Grid'5000 platform
https://www.grid5000.fr/
Other
6 stars 4 forks source link

get_host_attributes(c + '-1') call fail [proposed Label] bug #106

Open quentinLeDilavrec opened 6 years ago

quentinLeDilavrec commented 6 years ago

https://github.com/lpouillo/vm5k/blob/3819d42af2ed4aa76a4c2caf00ed0443b9302aa9/bin/vm5k#L151 appending '-1' at the end of c cause an error in get_host_attributes because there is no 'graphene-1' key in the dictionary used to retrieve attributes.

my work around is the following:


hosts = get_api_data()['hosts'] 

nodes = [
[a for a in hosts.keys() if b in a ][0]                                
for b in get_g5k_clusters()]

blacklisted = [
a.split('-')[0]                                                                 
for a in nodes
if not hosts[a]['supported_job_types']['virtual']]