add support for __cdist_type_mydir to find dir of current type

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
remotes/origin/1.0
Nico Schottelius 14 years ago
parent 43e6db264b
commit 3892f9e713
  1. 8
      bin/cdist-config
  2. 1
      bin/cdist_tree_wrapper

@ -31,13 +31,14 @@
: ${__cdist_name_explorer:=explorers}
: ${__cdist_name_host:=hosts}
: ${__cdist_name_init:=init}
: ${__cdist_name_manifest:=manifests}
: ${__cdist_name_object:=objects}
: ${__cdist_name_type:=types}
# Base
: ${__cdist_config:=/etc/cdist}
: ${__cdist_explorer_dir:=$__cdist_config/$__cdist_name_explorer}
: ${__cdist_manifest_dir:=$__cdist_config/manifests}
: ${__cdist_manifest_dir:=$__cdist_config/$__cdist_name_manifest}
: ${__cdist_manifest_init:=$__cdist_manifest_dir/$__cdist_name_init}
: ${__cdist_type_dir:=$__cdist_config/$__cdist_name_type}
@ -113,6 +114,11 @@ __cdist_cache_host()
echo "${__cdist_cache_hosts}/${__cdist_target_host}"
}
__cdist_type_mydir()
{
echo "${__cdist_type_dir}/${__cdist_type_current}"
}
__cdist_tmp_removal()
{
rm -rf "${__cdist_tmp_dir}"

@ -33,6 +33,7 @@ set -eu
echo "I am $__cdist_myname and have been called with $@"
export __cdist_object_id="$1"; shift
export __cdist_type_current="$__cdist_myname"
echo "$__cdist_object_id" | grep -q "^${__cdist_sane_regexp}\$" || __cdist_usage "Provide sane id, please"

Loading…
Cancel
Save