在volttron/platform/store.py文件中,它包含:
@ RPC.export
@ RPC.allow ('edit_config_store')
def manage_store (self, identity, config_name, raw_contents, config_type = "raw"):
contents = process_raw_config (raw_contents, config_type)
self._add_config_to_store (identity, config_name, raw_contents, contents, config_type,
trigger_callback = True)
为了从外部调用这个函数,我编写了如下代码。
self.vip.rpc.call (CONFIGURATION_STORE, "manage_store", 'platform.driver', config_name, raw_contents, 'json')
错误代码如下。
volttron.platform.jsonrpc.Error: method "manage_store" requires capabilities {'edit_config_store'}, but capability [] was provided for user pnp
auth 注册如下。
INDEX: 8
{
"domain": null,
"address": null,
"mechanism": "CURVE",
"credentials": "6vjPXC8ctO8oWkeMXAOe5FsAM9vZD_sg0vkLrstnVFs",
"groups": [],
"roles": [],
"capabilities": {
"edit_config_store": {
"identity": "pnp.b"
}
},
"comments": "Automatically added on agent install",
"user_id": "pnp.b",
"enabled": true
}
如何修复能力?