-
Notifications
You must be signed in to change notification settings - Fork 26
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
Default provider is ignore #44
Conversation
I think you are correct, the default provider is respected when a capability starts another capability which it depends on, but not when the user passes any empty string as the preferred provider for the I'll fix this. |
I now have a test to reproduce this, fix coming soon. |
Ok, fix pushed, I'll wait for CI to catch up and then merge. @jonbinney for review |
@@ -609,15 +609,14 @@ def __get_providers_for_interface(self, interface): | |||
def __start_capability(self, capability, preferred_provider): | |||
if capability not in self.__spec_index.interfaces.keys() + self.__spec_index.semantic_interfaces.keys(): | |||
raise RuntimeError("Capability '{0}' not found.".format(capability)) | |||
# If not preferred provider is given, use the default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not preferred provider is given, use the default you must!
testing it now on my setup |
Works for me, and i don't see any problems with the code. Thanks william! |
I fixed the typo and cleaned up the code to have 100% coverage again. Waiting to merge until CI and coveralls catches up. |
But the typo was awesome :-( |
See - even travis fails without the typo... |
😜 |
It's possible I'm misunderstanding how default providers work, but it appears that if there are multiple providers for an interface, and a default is defined, it isn't necessarily used. Instead, start_capability() just uses the first provider in the list:
https://github.com/osrf/capabilities/blob/master/src/capabilities/server.py#L620