summaryrefslogtreecommitdiff
path: root/scripts/yaml-extract
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/yaml-extract')
-rwxr-xr-xscripts/yaml-extract4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/yaml-extract b/scripts/yaml-extract
index 5a945b6d..6f55e62f 100755
--- a/scripts/yaml-extract
+++ b/scripts/yaml-extract
@@ -28,7 +28,7 @@
# values for missing fields (e.g., the morph field if name is given).
# Construct your tests accordingly.
-# Copyright (C) 2013 Codethink Limited
+# Copyright (C) 2013-2014 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -52,6 +52,8 @@ with open(sys.argv[1]) as f:
obj = yaml.safe_load(f)
for thing in sys.argv[2:]:
if type(obj) == dict:
+ if thing not in obj:
+ raise Exception("Object does not contain %s" % thing)
obj = obj[thing]
elif type(obj) == list:
if '=' in thing: