Commit 38181862 authored by Stefanos Laskaridis's avatar Stefanos Laskaridis
Browse files

Fix private key path problem for service and central vm manager.

parent 9b928d62
......@@ -105,6 +105,7 @@ if __name__ == "__main__":
csm.central_service_create(vm_name=args.vm_name,
vcpus=args.vcpus, ram=args.ram, disk=args.disk,
project_name=args.project_name,
private_key_path=args.private_key_path,
public_key_path=args.public_key_path)
elif args.vm_id is None:
raise ValueError("VM id must be specified")
......
......@@ -14,13 +14,13 @@ class Manager:
"or the location specified (if any). Please re-run, specifying a " \
"valid private key file."
raise IOError(message)
ansible.constants.DEFAULT_PRIVATE_KEY_FILE = private_key_path
ansible.constants.HOST_KEY_CHECKING = False
ansible.constants.DEFAULT_TIMEOUT = 30
self.ansible_inventory = ansible.inventory.Inventory(host_list=[host])
all_group = self.ansible_inventory.get_group('all')
ansible_host = all_group.get_hosts()[0]
ansible_host.set_variable('ansible_ssh_private_key_file', private_key_path)
ansible_group = ansible.inventory.group.Group(name=group)
ansible_group.add_host(ansible_host)
self.ansible_inventory.add_group(ansible_group)
......
......@@ -142,6 +142,7 @@ if __name__ == "__main__":
sm.service_vm_create(vm_name=args.vm_name,
vcpus=args.vcpus, ram=args.ram, disk=args.disk,
project_name=args.project_name,
private_key_path=args.private_key_path,
public_key_path=args.public_key_path)
elif args.vm_id is None:
raise ValueError("VM id must be specified")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment