From e921986e32f9fb049a4b22f4de925eedfb797a73 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 22 Mar 2011 08:57:19 +0100 Subject: [PATCH] remove double slash in __cdist_object in bin/cdist-type-emulator Signed-off-by: Nico Schottelius --- bin/cdist-type-emulator | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/cdist-type-emulator b/bin/cdist-type-emulator index 063afd92..9f272569 100755 --- a/bin/cdist-type-emulator +++ b/bin/cdist-type-emulator @@ -40,7 +40,13 @@ fi echo "$__cdist_object_id" | grep -q "^${__cdist_sane_regexp}\$" || \ __cdist_usage "Insane object id, ${__cdist_object_id}." -__cdist_object="${__cdist_type}/${__cdist_object_id}" +# Remove double slash if id begins with / +if [ "$(echo $__cdist_object_id | grep "^/")" ]; then + __cdist_object="${__cdist_type}${__cdist_object_id}" +else + __cdist_object="${__cdist_type}/${__cdist_object_id}" +fi + __cdist_ddir="$(__cdist_object_dir "$__cdist_object")" __cdist_parameter_dir="$(__cdist_object_parameter_dir "$__cdist_object")"