summaryrefslogtreecommitdiff
path: root/buildscripts/yaml_key_value.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/yaml_key_value.py')
-rwxr-xr-xbuildscripts/yaml_key_value.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/buildscripts/yaml_key_value.py b/buildscripts/yaml_key_value.py
index 353e87df7ea..27e975433d4 100755
--- a/buildscripts/yaml_key_value.py
+++ b/buildscripts/yaml_key_value.py
@@ -9,7 +9,7 @@ import yaml
def get_yaml_value(yaml_file, yaml_key):
- """Return string value for 'yaml_key' from 'yaml_file.'"""
+ """Return string value for 'yaml_key' from 'yaml_file'."""
with open(yaml_file, "r") as ystream:
yaml_dict = yaml.safe_load(ystream)
return str(yaml_dict.get(yaml_key, ""))
@@ -20,8 +20,8 @@ def main():
parser = optparse.OptionParser(description=__doc__)
parser.add_option("--yamlFile", dest="yaml_file", default=None, help="YAML file to read")
- parser.add_option(
- "--yamlKey", dest="yaml_key", default=None, help="Top level YAML key to provide the value")
+ parser.add_option("--yamlKey", dest="yaml_key", default=None,
+ help="Top level YAML key to provide the value")
(options, _) = parser.parse_args()
if not options.yaml_file:
@@ -31,5 +31,6 @@ def main():
print(get_yaml_value(options.yaml_file, options.yaml_key))
+
if __name__ == "__main__":
main()