From 85b467faa66414857be13995caca4806df6708cf Mon Sep 17 00:00:00 2001 From: Pedro Escaleira Date: Tue, 5 Apr 2022 21:01:37 +0100 Subject: [PATCH] Bug 2003 fixed: added the possibility to deploy bundles from the Charm Hub Also upgraded the version of the juju library to 2.9.8 (and made the necessary changes to the code to work with this version), once the previous version didn't supported Bundles from the Charm Hub Change-Id: I34d87dff75b4e77fdbdaef0eaf4da565b0bf213b Signed-off-by: Pedro Escaleira (cherry picked from commit 86a6314b0ef63ee2292d1486138e011bf82e6d85) --- n2vc/k8s_juju_conn.py | 4 ++++ n2vc/libjuju.py | 2 +- requirements.in | 2 +- requirements.txt | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/n2vc/k8s_juju_conn.py b/n2vc/k8s_juju_conn.py index 29ff8ccb..b6955364 100644 --- a/n2vc/k8s_juju_conn.py +++ b/n2vc/k8s_juju_conn.py @@ -303,6 +303,10 @@ class K8sJujuConnector(K8sConnector): raise K8sException("bundle must be set") if bundle.startswith("cs:"): + # For Juju Bundles provided by the Charm Store + pass + elif bundle.startswith("ch:"): + # For Juju Bundles provided by the Charm Hub (this only works for juju version >= 2.9) pass elif bundle.startswith("http"): # Download the file diff --git a/n2vc/libjuju.py b/n2vc/libjuju.py index 6580067c..8324cd42 100644 --- a/n2vc/libjuju.py +++ b/n2vc/libjuju.py @@ -94,7 +94,7 @@ class Libjuju: """ controller = None try: - controller = Controller(loop=self.loop) + controller = Controller() await asyncio.wait_for( controller.connect( endpoint=self.vca_connection.data.endpoints, diff --git a/requirements.in b/requirements.in index ce72c777..576d1ff4 100644 --- a/requirements.in +++ b/requirements.in @@ -13,7 +13,7 @@ # limitations under the License. async-timeout<4 -juju==2.9.4 +juju==2.9.8 kubernetes motor==1.3.1 pyasn1 diff --git a/requirements.txt b/requirements.txt index c4aaea69..ef0d3a98 100644 --- a/requirements.txt +++ b/requirements.txt @@ -39,7 +39,7 @@ google-auth==2.3.3 # via kubernetes idna==3.3 # via requests -juju==2.9.4 +juju==2.9.8 # via -r requirements.in jujubundlelib==0.5.7 # via theblues -- 2.25.1