class Command:
+ # placeholder for retry feature
+ # tries: int = 1
+ # delay: int = 1
+ # backoff: int = 2
pass
--- /dev/null
+# Copyright (C) 2022 Wind River Systems, Inc.\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+# pylint: disable=too-few-public-methods\r
+\r
+class Orano2Exception(Exception):\r
+ pass\r
--- /dev/null
+\r
+# Copyright (C) 2022 Wind River Systems, Inc.\r
+#\r
+# Licensed under the Apache License, Version 2.0 (the "License");\r
+# you may not use this file except in compliance with the License.\r
+# You may obtain a copy of the License at\r
+#\r
+# http://www.apache.org/licenses/LICENSE-2.0\r
+#\r
+# Unless required by applicable law or agreed to in writing, software\r
+# distributed under the License is distributed on an "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+# See the License for the specific language governing permissions and\r
+# limitations under the License.\r
+\r
+# pylint: disable=too-few-public-methods\r
+\r
+from o2common.domain.exceptions import Orano2Exception\r
+\r
+\r
+class NfdeploymentNotFoundError(Orano2Exception):\r
+ pass\r
Updating = 4\r
Uninstalling = 5\r
Abnormal = 6\r
- Deleted = 7\r
+ Deleting = 7\r
# Aborting = 8\r
from o2dms.domain import commands
from typing import Callable
+from o2dms.domain.exceptions import NfdeploymentNotFoundError
from o2dms.domain import events
from o2common.service.unit_of_work import AbstractUnitOfWork
from helm_sdk import Helm
# retry 10 seconds
-@retry(tries=20, max_delay=10000)
+@retry(
+ (NfdeploymentNotFoundError),
+ tries=100,
+ delay=2, max_delay=10000, backoff=1)
def _retry_get_nfdeployment(
cmd: commands.InstallNfDeployment,
uow: AbstractUnitOfWork):
nfdeployment: NfDeployment = uow.nfdeployments.get(
cmd.NfDeploymentId)
if nfdeployment is None:
- raise Exception("Cannot find NfDeployment: {}".format(
- cmd.NfDeploymentId))
+ raise NfdeploymentNotFoundError(
+ "Cannot find NfDeployment: {}".format(
+ cmd.NfDeploymentId))
return nfdeployment
Updating = 4
Uninstalling = 5
Abnormal = 6
- Deleted = 7
+ Deleting = 7