Closed si-kotic closed 2 years ago
Thank you for reporting this issue!
It seems the docs are incorrect. The load_dict
function requires two parameters, the first one being a onepasswordconnectsdk.Client
and the second one being the config.
So you should call load_dict
like this:
import onepasswordconnectsdk
CONFIG = {
"server": {
"opitem": "My database item",
"opfield": "specific_section.hostname",
"opvault": "some_vault_id",
},
"database": {
"opitem": "My database item",
"opfield": ".database",
},
"username": {
"opitem": "My database item",
"opfield": ".username",
},
"password": {
"opitem": "My database item",
"opfield": ".password",
},
}
client = new_client_from_environment()
values_dict = onepasswordconnectsdk.load_dict(client, CONFIG)
I will open a PR and fix the docs soon!
Closed. Please reopen the issue if you run into any other problems related to this!
Your environment
SDK Version: 1.1.0
Connect Server Version:1.5.0
OS: Ubuntu 20.04
Python Version: 3.8.2
What happened?
When following the instructions to create a
dict
to limit the fields returned, I receive the following error:load_dict() missing 1 required positional argument: 'config'
If I copy and paste the text from the README, I get the same error.What did you expect to happen?
The variable
values_dict
to be set with the the value returned fromonepasswordconnectsdk.load_dict(CONFIG)
Steps to reproduce