Comment 9 for bug 1722842

Revision history for this message
Thomas Morin (tmmorin-orange) wrote :

> (I still don't know why the qos-bw-limit-direction does not have this issue)

Hmm, yes, I see:

# The resource attribute map for the extension.
SUB_RESOURCE_ATTRIBUTE_MAP = {
    qos.BANDWIDTH_LIMIT_RULES: {
        'parameters': dict(
> qos.SUB_RESOURCE_ATTRIBUTE_MAP[
> qos.BANDWIDTH_LIMIT_RULES]['parameters'],
>
            **{'direction': {
                'allow_post': True,
                'allow_put': True,
                'is_visible': True,
                'default': common_constants.EGRESS_DIRECTION,
                'validate': {
                    'type:values': common_constants.VALID_DIRECTIONS}}}
        )
    }
}

The extension copies the base attributes to avoid overwriting.

Of course the trick works only when all the extensions extending something know each other, and will fall apart with more.

Doesn't it make sense to support this in a cleaner way ?

(I'll be glad to update my change to remove this cludge in the qos-bw-limit-direction extension)