scripts: accept absolute paths to YAML
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I94044f096db64e6152bf4e7cd3bff7159e1cc85a
diff --git a/configure.ac b/configure.ac
index 72d408b..3cacf44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,10 +62,10 @@
AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
)
-AS_IF([test "x$YAML_GEN" == "x"], [YAML_GEN="example.yaml"])
+AS_IF([test "x$YAML_GEN" == "x"], [YAML_GEN="scripts/example.yaml"])
FRUGEN="$PYTHON $srcdir/scripts/fru_gen.py -i $YAML_GEN"
AC_SUBST(FRUGEN)
-AS_IF([test "x$PROP_YAML" == "x"], [PROP_YAML="extra-properties-example.yaml"])
+AS_IF([test "x$PROP_YAML" == "x"], [PROP_YAML="scripts/extra-properties-example.yaml"])
PROPGEN="$PYTHON $srcdir/scripts/extra-properties.py -e $PROP_YAML"
AC_SUBST(PROPGEN)
diff --git a/scripts/extra-properties.py b/scripts/extra-properties.py
index 115abf7..465f95c 100755
--- a/scripts/extra-properties.py
+++ b/scripts/extra-properties.py
@@ -21,7 +21,7 @@
)
args = parser.parse_args()
- with open(os.path.join(script_dir, args.extra_props_yaml), "r") as fd:
+ with open(args.extra_props_yaml, "r") as fd:
yamlDict = yaml.safe_load(fd)
# Render the mako template
diff --git a/scripts/fru_gen.py b/scripts/fru_gen.py
index 624d052..06208df 100755
--- a/scripts/fru_gen.py
+++ b/scripts/fru_gen.py
@@ -9,7 +9,7 @@
def generate_cpp(inventory_yaml, output_dir):
- with open(os.path.join(script_dir, inventory_yaml), "r") as f:
+ with open(inventory_yaml, "r") as f:
ifile = yaml.safe_load(f)
if not isinstance(ifile, dict):
ifile = {}
@@ -55,7 +55,7 @@
args = parser.parse_args()
- if not (os.path.isfile(os.path.join(script_dir, args.inventory_yaml))):
+ if not (os.path.isfile(args.inventory_yaml)):
sys.exit("Can not find input yaml file " + args.inventory_yaml)
function = valid_commands[args.command]