The retrying_async library is not Python 3.10 ready, so we are providing
a 3.10 compatible callback for it to use instead of the default one
Change-Id: I15e9b64c70d4d294c9ff0c6c7048cd257f6e1b61
Signed-off-by: Mark Beierl <mark.beierl@canonical.com>
V1SecretReference,
)
from kubernetes.client.rest import ApiException
V1SecretReference,
)
from kubernetes.client.rest import ApiException
+from n2vc.libjuju import retry_callback
from retrying_async import retry
from retrying_async import retry
attempts=10,
delay=1,
fallback=Exception("Failed getting the secret from service account"),
attempts=10,
delay=1,
fallback=Exception("Failed getting the secret from service account"),
+ callback=retry_callback,
)
async def get_secret_data(
self, name: str, namespace: str = "kube-system"
)
async def get_secret_data(
self, name: str, namespace: str = "kube-system"
)
from n2vc.n2vc_conn import N2VCConnector
from n2vc.n2vc_conn import obj_to_dict, obj_to_yaml
)
from n2vc.n2vc_conn import N2VCConnector
from n2vc.n2vc_conn import obj_to_dict, obj_to_yaml
-from n2vc.libjuju import Libjuju
+from n2vc.libjuju import Libjuju, retry_callback
from n2vc.store import MotorStore
from n2vc.utils import get_ee_id_components, generate_random_alfanum_string
from n2vc.vca.connection import get_connection
from n2vc.store import MotorStore
from n2vc.utils import get_ee_id_components, generate_random_alfanum_string
from n2vc.vca.connection import get_connection
# In case of native_charm is being deployed, if JujuApplicationExists error happens
# it will try to add_unit
# In case of native_charm is being deployed, if JujuApplicationExists error happens
# it will try to add_unit
- @retry(attempts=3, delay=5, retry_exceptions=(N2VCApplicationExists,), timeout=None)
+ @retry(
+ attempts=3,
+ delay=5,
+ retry_exceptions=(N2VCApplicationExists,),
+ timeout=None,
+ callback=retry_callback,
+ )
async def install_configuration_sw(
self,
ee_id: str,
async def install_configuration_sw(
self,
ee_id: str,