From 84ee17e41b286c46bf16b4c95817706297b8100e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20J=C3=BAnior?= Date: Wed, 18 Aug 2021 21:02:28 -0300 Subject: [PATCH] bypass instance id validation --- networkapi/util/geral.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/networkapi/util/geral.py b/networkapi/util/geral.py index e8d68342..2d79ab50 100644 --- a/networkapi/util/geral.py +++ b/networkapi/util/geral.py @@ -72,8 +72,12 @@ def create_lock_with_blocking(locks_name): for lock_name in locks_name: try: lock = distributedlock(lock_name, blocking=False) + # TODO: This is a temporary solution for a high needed change. In the future we need to validate + # why destroy_lock in models/create_v3 didn't work some times + if lock.get_cached_data(): log.info('Get cached lock data for {}. Disabling it and creating a new lock'.format(lock_name)) + lock.lock.instance_id = lock.get_cached_data() lock.__exit__('', '', '') lock.__enter__() locks_list.append(lock)