Merge pull request #381 from acatton/cleanup-default-parameters

Types default values handeling cleanup
remotes/origin/3.1
Nico Schottelius 10 years ago
commit 057f4c1be7
  1. 8
      cdist/conf/type/__apt_source/manifest
  2. 0
      cdist/conf/type/__apt_source/parameter/default/component
  3. 12
      cdist/conf/type/__cdistmarker/gencode-remote
  4. 1
      cdist/conf/type/__cdistmarker/parameter/default/destination
  5. 1
      cdist/conf/type/__cdistmarker/parameter/default/format
  6. 1
      cdist/conf/type/__mysql_database/gencode-remote
  7. 6
      cdist/conf/type/__package_apt/gencode-remote
  8. 1
      cdist/conf/type/__package_apt/parameter/default/state
  9. 6
      cdist/conf/type/__package_luarocks/gencode-remote
  10. 1
      cdist/conf/type/__package_luarocks/parameter/default/state
  11. 6
      cdist/conf/type/__package_opkg/gencode-remote
  12. 1
      cdist/conf/type/__package_opkg/parameter/default/state
  13. 6
      cdist/conf/type/__package_pacman/gencode-remote
  14. 1
      cdist/conf/type/__package_pacman/parameter/default/state
  15. 6
      cdist/conf/type/__package_pip/gencode-remote
  16. 1
      cdist/conf/type/__package_pip/parameter/default/state
  17. 21
      cdist/conf/type/__package_pkg_freebsd/gencode-remote
  18. 0
      cdist/conf/type/__package_pkg_freebsd/parameter/default/flavor
  19. 0
      cdist/conf/type/__package_pkg_freebsd/parameter/default/pkgsite
  20. 1
      cdist/conf/type/__package_pkg_freebsd/parameter/default/state
  21. 0
      cdist/conf/type/__package_pkg_freebsd/parameter/default/version
  22. 6
      cdist/conf/type/__package_pkg_openbsd/gencode-remote
  23. 1
      cdist/conf/type/__package_pkg_openbsd/parameter/default/state
  24. 20
      cdist/conf/type/__package_pkgng_freebsd/gencode-remote
  25. 0
      cdist/conf/type/__package_pkgng_freebsd/parameter/default/flavor
  26. 0
      cdist/conf/type/__package_pkgng_freebsd/parameter/default/repo
  27. 1
      cdist/conf/type/__package_pkgng_freebsd/parameter/default/state
  28. 0
      cdist/conf/type/__package_pkgng_freebsd/parameter/default/version
  29. 6
      cdist/conf/type/__package_rubygem/gencode-remote
  30. 1
      cdist/conf/type/__package_rubygem/parameter/default/state

@ -27,11 +27,9 @@ if [ -f "$__object/parameter/distribution" ]; then
else
distribution="$(cat "$__global/explorer/lsb_codename")"
fi
if [ -f "$__object/parameter/component" ]; then
component="$(cat "$__object/parameter/component")"
else
component=""
fi
component="$(cat "$__object/parameter/component")"
if [ -f "$__object/parameter/arch" ]; then
forcedarch="[arch=$(cat "$__object/parameter/arch")]"
else

@ -19,19 +19,11 @@
#
# The marker file is established in the docs, but it isn't obligatory.
if [ -f "$__object/parameter/destination" ]; then
destination="$(cat "$__object/parameter/destination")"
else
destination='/etc/cdist-configured'
fi
destination="$(cat "$__object/parameter/destination")"
# The basic output of date is usually good enough, but variety is the
# spice of life...
if [ -f "$__object/parameter/format" ]; then
format="$(cat "$__object/parameter/format")"
else
format='-u'
fi
format="$(cat "$__object/parameter/format")"
# Dump the timestamp in UTC to the marker
echo "date $format > $destination"

@ -45,7 +45,6 @@ if [ -f "$__object/parameter/user" ]; then
EOF
EOFF
else
password=""
cat <<-EOFF
mysql -u root <<-EOF
GRANT ALL PRIVILEGES ON $database.* to '$user'@'localhost';

@ -27,11 +27,7 @@ else
name="$__object_id"
fi
if [ -f "$__object/parameter/state" ]; then
state_should="$(cat "$__object/parameter/state")"
else
state_should="present"
fi
state_should="$(cat "$__object/parameter/state")"
if [ -f "$__object/parameter/target-release" ]; then
target_release="--target-release $(cat "$__object/parameter/target-release")"

@ -29,11 +29,7 @@ else
name="$__object_id"
fi
if [ -f "$__object/parameter/state" ]; then
state_should="$(cat "$__object/parameter/state")"
else
state_should="present"
fi
state_should="$(cat "$__object/parameter/state")"
if grep -q "(installed)" "$__object/explorer/pkg_status"; then
state_is="present"

@ -28,11 +28,7 @@ else
name="$__object_id"
fi
if [ -f "$__object/parameter/state" ]; then
state_should="$(cat "$__object/parameter/state")"
else
state_should="present"
fi
state_should="$(cat "$__object/parameter/state")"
state_is="$(cat "$__object/explorer/pkg_status")"
case "$state_is" in

@ -31,11 +31,7 @@ else
name="$__object_id"
fi
if [ -f "$__object/parameter/state" ]; then
state_should="$(cat "$__object/parameter/state")"
else
state_should="present"
fi
state_should="$(cat "$__object/parameter/state")"
pkg_version="$(cat "$__object/explorer/pkg_version")"
if [ -z "$pkg_version" ]; then

@ -22,11 +22,7 @@
#
state_is=$(cat "$__object/explorer/state")
if [ -f "$__object/parameter/state" ]; then
state_should="$(cat "$__object/parameter/state")"
else
state_should="present"
fi
state_should="$(cat "$__object/parameter/state")"
[ "$state_is" = "$state_should" ] && exit 0

@ -51,23 +51,10 @@ else
name="$__object_id"
fi
if [ -f "$__object/parameter/flavor" ]; then
flavor="$(cat "$__object/parameter/flavor")"
fi
if [ -f "$__object/parameter/version" ]; then
version="$(cat "$__object/parameter/version")"
fi
if [ -f "$__object/parameter/pkgsite" ]; then
pkgsite="$(cat "$__object/parameter/pkgsite")"
fi
if [ -f "$__object/parameter/state" ]; then
state="$(cat "$__object/parameter/state")"
else
state="present"
fi
flavor="$(cat "$__object/parameter/flavor")"
version="$(cat "$__object/parameter/version")"
pkgsite="$(cat "$__object/parameter/pkgsite")"
state="$(cat "$__object/parameter/state")"
curr_version="$(cat "$__object/explorer/pkg_version")"
add_cmd="pkg_add"
rm_cmd="pkg_delete"

@ -42,11 +42,7 @@ else
name="$__object_id"
fi
if [ -f "$__object/parameter/state" ]; then
state_should="$(cat "$__object/parameter/state")"
else
state_should="present"
fi
state_should="$(cat "$__object/parameter/state")"
pkg_version="$(cat "$__object/explorer/pkg_version")"

@ -31,13 +31,8 @@ else
name="$__object_id"
fi
if [ -f "$__object/parameter/flavor" ]; then
flavor="$(cat "$__object/parameter/flavor")"
fi
if [ -f "$__object/parameter/version" ]; then
version="$(cat "$__object/parameter/version")"
fi
flavor="$(cat "$__object/parameter/flavor")"
version="$(cat "$__object/parameter/version")"
if [ -f "$__object/parameter/upgrade" ]; then
upgrade="true"
@ -45,15 +40,8 @@ else
upgrade="false"
fi
if [ -f "$__object/parameter/repo" ]; then
repo="$(cat "$__object/parameter/repo")"
fi
if [ -f "$__object/parameter/state" ]; then
state="$(cat "$__object/parameter/state")"
else
state="present"
fi
repo="$(cat "$__object/parameter/repo")"
state="$(cat "$__object/parameter/state")"
curr_version="$(cat "$__object/explorer/pkg_version")"
add_cmd="pkg install -y"
rm_cmd="pkg delete -y"

@ -27,11 +27,7 @@ else
name="$__object_id"
fi
if [ -f "$__object/parameter/state" ]; then
state_should="$(cat "$__object/parameter/state")"
else
state_should="present"
fi
state_should="$(cat "$__object/parameter/state")"
if grep -q true "$__object/explorer/pkg_status"; then
state_is="present"

Loading…
Cancel
Save