-
Notifications
You must be signed in to change notification settings - Fork 195
WIP: Add enclave information #681
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
base: rolling
Are you sure you want to change the base?
Changes from 5 commits
459f6ad
8956780
c8deb25
a585738
5b10eae
ba61fc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |
| from ros2cli.node.strategy import NodeStrategy | ||
| from ros2node.api import get_action_client_info | ||
| from ros2node.api import get_action_server_info | ||
| from ros2node.api import get_node_names | ||
| from ros2node.api import get_node_names_with_enclaves | ||
| from ros2node.api import get_publisher_info | ||
| from ros2node.api import get_service_client_info | ||
| from ros2node.api import get_service_server_info | ||
|
|
@@ -28,6 +28,10 @@ | |
| from ros2node.verb import VerbExtension | ||
|
|
||
|
|
||
| def print_enclaves(enclaves): | ||
| print(*[2 * ' {}'.format(e) for e in enclaves if e != '/'], sep='\n') | ||
|
|
||
|
|
||
| def print_names_and_types(names_and_types): | ||
| print(*[2 * ' ' + s.name + ': ' + ', '.join(s.types) for s in names_and_types], sep='\n') | ||
|
|
||
|
|
@@ -47,8 +51,10 @@ def add_arguments(self, parser, cli_name): | |
|
|
||
| def main(self, *, args): | ||
| with NodeStrategy(args) as node: | ||
| node_names = get_node_names(node=node, include_hidden_nodes=args.include_hidden) | ||
| count = [n.full_name for n in node_names].count(args.node_name) | ||
| node_names_with_enclaves = get_node_names_with_enclaves( | ||
| node=node, | ||
| include_hidden_nodes=args.include_hidden) | ||
| count = [n.name.full_name for n in node_names_with_enclaves].count(args.node_name) | ||
| if count > 1: | ||
| print( | ||
| INFO_NONUNIQUE_WARNING_TEMPLATE.format( | ||
|
|
@@ -80,5 +86,9 @@ def main(self, *, args): | |
| node=node, remote_node_name=args.node_name, include_hidden=args.include_hidden) | ||
| print(' Action Clients:') | ||
| print_names_and_types(actions_clients) | ||
| print(' Enclaves:') | ||
| print_enclaves([n.enclave for n in node_names_with_enclaves | ||
| if n.name.full_name == args.node_name]) | ||
|
Comment on lines
+89
to
+91
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i am okay with either way, but we could consider this is one of the option for
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't sure which is the best option. My rationale for leaving it in the default output is:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any interest in this, or should I withdraw the PR? Internally, we've found that this information would be very useful for our development, and I'd like to help the community if possible.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is helpful. can you open this PR as
IMO, this is why i came up with option such as |
||
|
|
||
fujitatomoya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| else: | ||
| return "Unable to find node '" + args.node_name + "'" | ||
Uh oh!
There was an error while loading. Please reload this page.