Github user tliron commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/188#discussion_r130399573
  
    --- Diff: aria/storage/collection_instrumentation.py ---
    @@ -213,32 +235,32 @@ def __init__(self, mapi, *args, **kwargs):
             """
             The original model.
     
    -        :param wrapped: model to be instrumented
             :param mapi: MAPI for the wrapped model
    +        :param wrapped: model to be instrumented
    +        :param instrumentation: instrumentation dict
    +        :param instrumentation_kwargs: arguments for instrumentation class
             """
    -        super(_InstrumentedModel, self).__init__(*args, **kwargs)
    +        super(_InstrumentedModel, 
self).__init__(instrumentation_kwargs=dict(mapi=mapi),
    +                                                 *args, **kwargs)
             self._mapi = mapi
             self._apply_instrumentation()
     
    -    def __getattr__(self, item):
    -        return_value = getattr(self._wrapped, item)
    -        if isinstance(return_value, self._wrapped.__class__):
    -            return _create_instrumented_model(return_value, self._mapi, 
self._instrumentation)
    -        if isinstance(return_value, (list, dict)):
    -            return _create_wrapped_model(return_value, self._mapi, 
self._instrumentation)
    -        return return_value
    -
         def _apply_instrumentation(self):
             for field in self._instrumentation:
    +            if field.parent.class_ != type(self._wrapped):
    --- End diff --
    
    To fix: check by isubclass instead of equality


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to