-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added get_relation_data in Unit #700
Conversation
Can one of the admins verify this patch? |
8 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Thanks for the PR @PietroPasotti , I'll review this when you mark it as This will need a test as well to be approved. Also, I don't see how this fixes the #644 , are you adding more functionality? If you aren't, then feel free to remove that line (so that the issue won't close automatically when we land this), I have that one in my todo list anyways. Thanks again! |
This is a great addition @PietroPasotti. Would this work for peer data as well? Currently I'm using rc, stdout, stderr = await ops_test.run("juju", "show-unit", "app/0", "--format=json")
data = json.loads(stdout)
peer_data = next(filter(lambda d: d['endpoint'] == 'replicas', data["app/0"]["relation-info"])) |
Thanks for opening a pull request! Please follow the instructions here to ensure your pull request is ready for review. Then, a maintainer will review your patch. |
1 similar comment
Thanks for opening a pull request! Please follow the instructions here to ensure your pull request is ready for review. Then, a maintainer will review your patch. |
Ugh, had forgotten this was even here. I think peer data requires a little addition. I have it working in jhack, that's where this code originally came from. Putting it again in my todo list |
This PR is marked as incomplete because it has been open 30 days with no activity. Please remove incomplete label or comment or this will be closed in 5 days. |
This PR was closed because it has been stalled for 10 days with no activity. |
This PR adds to
Unit
aget_relation_data(endpoint:str, related_endpoint:str, remote:str)
method that returns 'raw' RelationData objects.Fixes #699
Fixes #644
(somewhat) Fixes charmed-kubernetes/pytest-operator#81
It would be nice, as a next step, to add a shortcut to access this data via the Relation object.
Note: this is untested code. Will finalize after a green light that this is indeed a good addition