cleaner way to set default values

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
remotes/origin/feature_files_export
Steven Armstrong 13 years ago
parent 85f7880c7e
commit 4628dad045
  1. 8
      conf/type/__key_value/explorer/value
  2. 9
      conf/type/__key_value/manifest

@ -21,11 +21,9 @@
# Get the current value of key or __NOTSET__ if the key doesn't exist.
#
if [ -f "$__object/parameter/key" ]; then
key="$(cat "$__object/parameter/key")"
else
key="$__object_id"
fi
key="$(cat "$__object/parameter/key" 2>/dev/null \
|| echo "$__object_id")"
file="$(cat "$__object/parameter/file")"
delimiter="$(cat "$__object/parameter/delimiter")"

@ -18,9 +18,6 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
if [ -f "$__object/parameter/key" ]; then
key="$(cat "$__object/parameter/key")"
else
echo "$__object_id" > "$__object/parameter/key"
fi
# set defaults
[ -f "$__object/parameter/key" ] \
|| echo "$__object_id" > "$__object/parameter/key"

Loading…
Cancel
Save