ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxmrlv <>
Subject [GitHub] incubator-ariatosca pull request #188: ARIA-324 Refactor ctx proxy access
Date Sun, 30 Jul 2017 12:27:47 GMT
Github user mxmrlv commented on a diff in the pull request:
    --- Diff: aria/storage/ ---
    @@ -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
    -    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 --
    I think this might break the recursive instrumentation, i.e. `relationship.source_node.outbound_relationships[0].attributes`
would not be instrumented.

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 or file a JIRA ticket
with INFRA.

View raw message