You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@kefeimo None of the list type data classes (pubsubcapabilities, rpc capabilities, agents etc.) have equals or hash method overwritten. I simply didn't have a need to compare objects directly using custom_list_type_objec1 == custom_list_type_object2. If you overwrite equals, you have to overwrite hash method too. I have to loop through these objects anyway in order to handle string type capabilities (say "vip1.rpc1") and nested dictionary type capabilities (say {"vip2.rpc2": {"param1":"value1"}}) differently when comparing or merging. So simply did not have a need for these methods. Nor did I implement str or repr. If there is a need, we can certainly add these methods
Just adding a bit more context- these data class are for VOLTTRON core internal purposes only - ie. only admin role can call the AUTH service rpc method that in turn call the data class methods. That is also one of the reason for adding methods as need - i.e. iteratively - as we add end user user feature/vctl subparsers.
Describe the bug
RPCCapabilities class doesn't display properly for mergeable cases. (side-effect: the equal action is wrong.)
To Reproduce
// Affected commit: V10
i.e., https://github.com/eclipse-volttron/volttron-core/blob/v10/src/volttron/types/auth/authz_types.py
// Steps to reproduce the behavior:
Use the following code snippet to reproduce the error
result
Expected behavior
rpc_obj_list_2 should display the same as rpc_obj_list_3, i.e.,
RPCCapabilities(rpc_capabilities=[RPCCapability(resource='id.rpc1', param_restrictions={}), RPCCapability(resource='id2.rpc2', param_restrictions={'id': 'id2', 'param2': 'v2', 'p2': 'v2'})], _rpc_dict={'id.rpc1': {}, 'id2.rpc2': {'id': 'id2', 'param2': 'v2', 'p2': 'v2'}})
. However, it has repetitive items (i.e., RPCCapability(resource='id2.rpc2', param_restrictions={'id': 'id2', 'param2': 'v2', 'p2': 'v2'}), RPCCapability(resource='id2.rpc2', param_restrictions={'p2': 'v2', 'id': 'id2'}))In addition, (rpc_obj_list_2==rpc_obj_list_3) should be True.
Also pin @craig8 , @shwethanidd for discussion.
The text was updated successfully, but these errors were encountered: