summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Bridon <bochecha@daitauha.fr>2017-12-08 12:51:41 +0100
committerJürg Billeter <j@bitron.ch>2017-12-12 21:35:28 +0100
commitbc90bc5d6005cc5798899c84816ffe47f939b621 (patch)
tree65dc64352834cd3801c431d6a8277f6a9743ef8b
parentb29c50f25562ea9c26fc4241a737904a3f1f86c1 (diff)
downloadbuildstream-bc90bc5d6005cc5798899c84816ffe47f939b621.tar.gz
_plugincontext.py: Let plugins not have YAML defaults
Source plugins typically do not have an accompanying YAML file with their default settings.
-rw-r--r--buildstream/_plugincontext.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/buildstream/_plugincontext.py b/buildstream/_plugincontext.py
index 3b82954ed..9bd3bf808 100644
--- a/buildstream/_plugincontext.py
+++ b/buildstream/_plugincontext.py
@@ -101,10 +101,14 @@ class PluginContext():
# Also load the defaults - required since setuptools
# may need to extract the file.
- defaults = plugin.dist.get_resource_filename(
- pkg_resources._manager,
- plugin.module_name.replace('.', os.sep) + '.yaml'
- )
+ try:
+ defaults = plugin.dist.get_resource_filename(
+ pkg_resources._manager,
+ plugin.module_name.replace('.', os.sep) + '.yaml'
+ )
+ except KeyError:
+ # The plugin didn't have an accompanying YAML file
+ defaults = None
# Set the plugin-base source to the setuptools directory
source = self.plugin_base.make_plugin_source(searchpath=[os.path.dirname(location)])