ariatosca-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (ARIA-262) Inconsistent node attributes behavior
Date Sun, 04 Jun 2017 16:20:05 GMT


ASF GitHub Bot commented on ARIA-262:

Github user mxmrlv commented on a diff in the pull request:
    --- Diff: aria/orchestrator/ ---
    @@ -68,11 +68,13 @@ def operation(func=None, toolbelt=False, suffix_template='', logging_handlers=No
         def _wrapper(**func_kwargs):
    +        ctx = func_kwargs.pop('ctx')
             if toolbelt:
    -            operation_toolbelt = context.toolbelt(func_kwargs['ctx'])
    +            operation_toolbelt = context.toolbelt(ctx)
                 func_kwargs.setdefault('toolbelt', operation_toolbelt)
    -        validate_function_arguments(func, func_kwargs)
    -        return func(**func_kwargs)
    +        validate_function_arguments(func, ctx=ctx, **func_kwargs)
    --- End diff --

> Inconsistent node attributes behavior
> -------------------------------------
>                 Key: ARIA-262
>                 URL:
>             Project: AriaTosca
>          Issue Type: Story
>            Reporter: Maxim Orlov
>            Assignee: Maxim Orlov
> ARIA provides sugaring for node attributes. However this sugaring is somewhat limited,
as it sugars ctx accessed attributes. e.g. Under NodeOperationContext {{ctx.node.attributes}}
has a dict-like behavior, where the value is another object with a dict-like behavior. This
is provided by the sugaring. 
> However {{ctx.node.relationships[0].target_node.attributes}} provides a dict where the
value is of type Parameter, accessing the value of this Parameter requires {{param.value}}
This creates inconsistency with regards to access to attributes.
> There are several possible solutions:
> 1. Enable sugaring on the model level. this will effectively make the creation of Parameter
implicit, but this will be possible throughout the entire code (not only under context).
> 2. Enable sugaring by tapping to sqla events and altering the return values. 

This message was sent by Atlassian JIRA

View raw message