diff options
author | Marcel Enguehard <mengueha+fdio@cisco.com> | 2017-05-29 15:54:39 +0200 |
---|---|---|
committer | Marcel Enguehard <mengueha+fdio@cisco.com> | 2017-05-29 15:54:39 +0200 |
commit | 97c6a8bb1847febe8bda5f95e19f527cabc060b9 (patch) | |
tree | eef5bd3a9c10179d59205f11240535d8be20f5ee /vicn/core/resource.py | |
parent | a836e5c16ea7df38646c46f2e9ffc6163ab05f06 (diff) |
Misc bug fixes: VPP, deb package detection, lxd
Change-Id: Ib3d339e636c0ec62dc0fe3227af85bcc167445cf
Signed-off-by: Marcel Enguehard <mengueha+fdio@cisco.com>
Diffstat (limited to 'vicn/core/resource.py')
-rw-r--r-- | vicn/core/resource.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vicn/core/resource.py b/vicn/core/resource.py index 9044ec21..f92e1255 100644 --- a/vicn/core/resource.py +++ b/vicn/core/resource.py @@ -288,6 +288,8 @@ class BaseResource(BaseType, ABC, metaclass=ResourceMetaclass): # Automatic instanciation # # Used for instance in route.node.routing_table.routes + # XXX We can only auto_instanciate local attributes, otherwise we + # get issues with asyncio loop not present in thread if attribute.requirements: log.warning('Ignored requirements {}'.format( attribute.requirements)) @@ -301,7 +303,8 @@ class BaseResource(BaseType, ABC, metaclass=ResourceMetaclass): value = self.get_default(attribute) self.set(attribute.name, value) else: - log.info("Fetching remote value for {}.{}".format(self,attribute.name)) + # printing self might do an infinite loop here ! + log.info("Fetching remote value for {}.{}".format(self.get_uuid(), attribute.name)) task = getattr(self, "_get_{}".format(attribute.name))() #XXX This is ugly but it prevents the LxdNotFound exception while True: @@ -315,7 +318,7 @@ class BaseResource(BaseType, ABC, metaclass=ResourceMetaclass): import traceback; traceback.print_tb(e.__traceback__) log.error("Failed to retrieve remote value for {} on {}".format(attribute.name, self)) import os; os._exit(1) - value = rv[attribute.name] + value = rv[attribute.name] if isinstance(rv, dict) else rv vars(self)[attribute.name] = value if unref and isinstance(value, UUID): |