From 0a1bc3861da07326bc3917374cdce7e471a67b70 Mon Sep 17 00:00:00 2001 From: David Garcia Date: Wed, 1 Jul 2020 20:25:30 +0200 Subject: [PATCH] Update database with api_endpoints of VCA on initialization Change-Id: Id5666d8c93d357632efde93e8e60abafdad56e35 Signed-off-by: David Garcia (cherry picked from commit 2cf8b2e0cd32ab2e8f3913ae9c5e156710465240) --- n2vc/libjuju.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/n2vc/libjuju.py b/n2vc/libjuju.py index daedc3b..be16e2a 100644 --- a/n2vc/libjuju.py +++ b/n2vc/libjuju.py @@ -70,7 +70,10 @@ class Libjuju: self.log = log or logging.getLogger("Libjuju") self.db = db - self.endpoints = self._get_api_endpoints_db() or [endpoint] + db_endpoints = self._get_api_endpoints_db() + self.endpoints = db_endpoints or [endpoint] + if db_endpoints is None: + self._update_api_endpoints_db(self.endpoints) self.api_proxy = api_proxy self.username = username self.password = password -- 2.25.1