copr: support for python-novaclient 3 in filter plugin for ansible
This commit is contained in:
parent
5aa4cb0f68
commit
ce641a1a7a
1 changed files with 4 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
from novaclient.v1_1.client import Client
|
||||
from novaclient.client import Client
|
||||
import re
|
||||
|
||||
def extract_ip_from_stdout(output):
|
||||
|
@ -12,17 +12,17 @@ def nova_result_to_builder_ip(nova_result, network_name):
|
|||
|
||||
|
||||
def network_name_to_id(network_name, username, password, tenant_name, auth_url):
|
||||
nt = Client(username, password, tenant_name, auth_url)
|
||||
nt = Client('2', username, password, tenant_name, auth_url)
|
||||
return nt.networks.find(label=network_name).id
|
||||
|
||||
|
||||
def image_name_to_id(image_name, username, password, tenant_name, auth_url):
|
||||
nt = Client(username, password, tenant_name, auth_url)
|
||||
nt = Client('2', username, password, tenant_name, auth_url)
|
||||
return nt.images.find(name=image_name).id
|
||||
|
||||
|
||||
def flavor_name_to_id(flavor_name, username, password, tenant_name, auth_url):
|
||||
nt = Client(username, password, tenant_name, auth_url)
|
||||
nt = Client('2', username, password, tenant_name, auth_url)
|
||||
return nt.flavors.find(name=flavor_name).id
|
||||
|
||||
|
||||
|
@ -38,4 +38,3 @@ class FilterModule(object):
|
|||
"extract_ip_from_stdout": extract_ip_from_stdout,
|
||||
# "network_id_to_name": network_id_to_name,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue