summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Maw <jonathan.maw@codethink.co.uk>2017-11-09 09:58:32 +0000
committerJonathan Maw <jonathan.maw@codethink.co.uk>2017-11-14 13:03:51 +0000
commitadd506fc22f2839bf1e41662f05f6f599f904714 (patch)
treeef1616c789a1c7d38a01f977ff106806d9260486
parentc92746c0092edd63e7c714dce71b78bbe59499e1 (diff)
downloadbuildstream-add506fc22f2839bf1e41662f05f6f599f904714.tar.gz
Change node_get_member to use default instead of default_value
-rw-r--r--buildstream/plugin.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/buildstream/plugin.py b/buildstream/plugin.py
index 5a7d70961..16b782e09 100644
--- a/buildstream/plugin.py
+++ b/buildstream/plugin.py
@@ -209,7 +209,7 @@ class Plugin():
provenance = _yaml.node_get_provenance(node, key=member_name)
return str(provenance)
- def node_get_member(self, node, expected_type, member_name, default_value=None):
+ def node_get_member(self, node, expected_type, member_name, default=None):
"""Fetch the value of a node member, raising an error if the value is
missing or incorrectly typed.
@@ -217,13 +217,13 @@ class Plugin():
node (dict): A dictionary loaded from YAML
expected_type (type): The expected type of the node member
member_name (str): The name of the member to fetch
- default_value (expected_type): A value to return when *member_name* is not specified in *node*
+ default (expected_type): A value to return when *member_name* is not specified in *node*
Returns:
- The value of *member_name* in *node*, otherwise *default_value*
+ The value of *member_name* in *node*, otherwise *default*
Raises:
- :class:`.LoadError`: When *member_name* is not found and no *default_value* was provided
+ :class:`.LoadError`: When *member_name* is not found and no *default* was provided
Note:
Returned strings are stripped of leading and trailing whitespace
@@ -238,7 +238,7 @@ class Plugin():
# Fetch an optional integer
level = self.node_get_member(node, int, 'level', -1)
"""
- return _yaml.node_get(node, expected_type, member_name, default_value=default_value)
+ return _yaml.node_get(node, expected_type, member_name, default_value=default)
def node_validate(self, node, valid_keys):
"""This should be used in :func:`~buildstream.plugin.Plugin.configure`