From 4986c6f7a1d5de66713bc4b7332ecccab9d64299 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 24 Mar 2015 17:08:40 +0000 Subject: [PATCH] Just comment this for now as we don't have v3 of nova either. --- filter_plugins/openstack.py | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/filter_plugins/openstack.py b/filter_plugins/openstack.py index 69266b4971..69cf00bf2d 100644 --- a/filter_plugins/openstack.py +++ b/filter_plugins/openstack.py @@ -1,26 +1,26 @@ -from ansible import errors, runner -import json -from novaclient.v3.client import Client -import novaclient.exceptions; - -def flavor_id_to_name(host_vars, user, password, tenant, auth_url): - nt = Client(user, password, tenant, auth_url, service_type="compute") - try: - flavor = nt.flavors.get(host_vars) - except novaclient.exceptions.NotFound: - raise errors.AnsibleFilterError('There is no flavor of name {0}'.format(host_vars)) - return flavor.name - - -def flavor_name_to_id(host_vars, user, password, tenant, auth_url): - nt = Client(user, password, tenant, auth_url, service_type="compute") - for i in nt.flavors.list(): - if i.name == host_vars: - return i.id - raise errors.AnsibleFilterError('There is no flavor of id {0}'.format(host_vars)) - -class FilterModule (object): - def filters(self): - return {"flavor_id_to_name": flavor_id_to_name, - "flavor_name_to_id": flavor_name_to_id, - } +#from ansible import errors, runner +#import json +#from novaclient.v3.client import Client +#import novaclient.exceptions; +# +#def flavor_id_to_name(host_vars, user, password, tenant, auth_url): +# nt = Client(user, password, tenant, auth_url, service_type="compute") +# try: +# flavor = nt.flavors.get(host_vars) +# except novaclient.exceptions.NotFound: +# raise errors.AnsibleFilterError('There is no flavor of name {0}'.format(host_vars)) +# return flavor.name +# +# +#def flavor_name_to_id(host_vars, user, password, tenant, auth_url): +# nt = Client(user, password, tenant, auth_url, service_type="compute") +# for i in nt.flavors.list(): +# if i.name == host_vars: +# return i.id +# raise errors.AnsibleFilterError('There is no flavor of id {0}'.format(host_vars)) +# +#class FilterModule (object): +# def filters(self): +# return {"flavor_id_to_name": flavor_id_to_name, +# "flavor_name_to_id": flavor_name_to_id, +# }