From 731422a6dc12b9a88d114d9b6423377837f181f3 Mon Sep 17 00:00:00 2001 From: Will Date: Mon, 24 Oct 2016 20:40:04 -0700 Subject: [PATCH] Fix lxd_container module fails if certificate already in trust store When the client certificate is already stored, lxd returns a JSON error with message "Certificate already in trust store". This "error" will occur on every task run after the initial run. The cert should be in the trust store after the first run and this error message should really only be viewed as informational as it does not indicate a real problem. Fixes: ansible/ansible-modules-extras#2750 (cherry picked from commit 1f30bc8a6ff0654473dc476ff88ee2ba4a13702e) --- lib/ansible/module_utils/lxd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/module_utils/lxd.py b/lib/ansible/module_utils/lxd.py index b08cb3961ab..1b869e20ad6 100644 --- a/lib/ansible/module_utils/lxd.py +++ b/lib/ansible/module_utils/lxd.py @@ -121,6 +121,8 @@ class LXDClient(object): if resp_type == 'error': if ok_error_codes is not None and resp_json['error_code'] in ok_error_codes: return resp_json + if resp_json['error'] == "Certificate already in trust store": + return resp_json self._raise_err_from_json(resp_json) return resp_json except socket.error as e: