From 0de5305eac99a1a48489a281ed5f8822443717ac Mon Sep 17 00:00:00 2001 From: forest Date: Mon, 15 Feb 2021 21:17:10 -0600 Subject: [PATCH] explain error from vms with no ip yet --- capsulflask/spoke_api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/capsulflask/spoke_api.py b/capsulflask/spoke_api.py index 9fcf502..e60d05f 100644 --- a/capsulflask/spoke_api.py +++ b/capsulflask/spoke_api.py @@ -90,6 +90,11 @@ def handle_get(operation_id, request_body): return abort(400, f"bad request; id is required for get") vm = current_app.config['SPOKE_MODEL'].get(request_body['id'], request_body['get_ssh_host_keys']) + # TODO vm can be None when the capsul exists on this host but has no IP address yet + # when this happens it logs an "error reading assignment_status" + # To fix this we need to + # 1. modify shell script to return does it exist on this host + if it does whats its ip + # 2. if exists but no ip, return assigned with no ip return jsonify(dict(assignment_status="assigned", id=vm.id, host=vm.host, ipv4=vm.ipv4, ipv6=vm.ipv6, ssh_host_keys=vm.ssh_host_keys))