diff options
author | Marcel Enguehard <mengueha+fdio@cisco.com> | 2017-10-09 08:44:59 +0200 |
---|---|---|
committer | Marcel Enguehard <mengueha+fdio@cisco.com> | 2017-10-09 08:55:46 +0200 |
commit | 5f8867a3454164ad20ae427dc9d2c7d65ea00a90 (patch) | |
tree | c8ff40fb147a76af2baa77790ba8a6ac968e51b4 /vicn/core/resource_mgr.py | |
parent | af2dd545d04cfca7e7ec066035abf78c3d541915 (diff) |
Several fixes related to async_set, ip addressing, and memif interfaces for VPP
Change-Id: I26b7928751f41ea66ba47bb1becac33cf5195915
Signed-off-by: Marcel Enguehard <mengueha+fdio@cisco.com>
Diffstat (limited to 'vicn/core/resource_mgr.py')
-rw-r--r-- | vicn/core/resource_mgr.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/vicn/core/resource_mgr.py b/vicn/core/resource_mgr.py index 8db7f04d..b4aa6bb7 100644 --- a/vicn/core/resource_mgr.py +++ b/vicn/core/resource_mgr.py @@ -587,7 +587,7 @@ class ResourceManager(metaclass=Singleton): await self.wait_attr_init(resource, attribute) return resource.get(attribute) - async def _attribute_set(self, resource, attribute_name, value): + async def _attribute_set(self, resource, attribute_name, value, blocking=False): with await resource._state.write_lock: attr_state = resource._state.attr_state[attribute_name] @@ -632,8 +632,8 @@ class ResourceManager(metaclass=Singleton): raise RuntimeError("Resource cannot be in state".format( resource_state)) -# if blocking: -# await self.wait_attr_clean(resource, attribute_name) + if blocking: + await self.wait_attr_clean(resource, attribute_name) def attribute_set(self, resource, attribute_name, value): # Add the current operation to the pending list @@ -643,15 +643,13 @@ class ResourceManager(metaclass=Singleton): value) asyncio.ensure_future(self._attribute_set(resource, attribute_name, value)) - async def attribute_set_async(self, resource, attribute_name, value): + async def attribute_async_set(self, resource, attribute_name, value): # Add the current operation to the pending list # NOTE: collections are unordered and can be updated concurrently #self._attribute_set_pending_value(resource, attribute_name) resource._state.dirty[attribute_name].trigger(Operations.SET, value) - await self._attribute_set(resource, attribute_name, value) - - + await self._attribute_set(resource, attribute_name, value, blocking=True) #--------------------------------------------------------------------------- # Resource dependency management |