From: Silvio Rhatto Date: Sun, 6 Mar 2016 02:00:17 +0000 (-0300) Subject: Cleanup X-Git-Tag: 0.2.4~216 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=6c77d5dfec211018d666d847e0c872928b989f02;p=hydra.git Cleanup --- diff --git a/share/hydra/nodes b/share/hydra/nodes index 4ddf916..e2a318d 100755 --- a/share/hydra/nodes +++ b/share/hydra/nodes @@ -20,31 +20,16 @@ function hydra_node_files { if [ -d "$PUPPET/hiera/node/" ]; then FILES="$PUPPET/hiera/node/*" - elif [ -d "$PUPPET/manifests/nodes/" ]; then - FILES="$PUPPET/manifests/nodes/*" - else - FILES="`find $PUPPET -name 'nodes.pp'`" fi } -# Get using the filename -function hydra_node_names { +# Return node names +function hydra_nodes { for file in $FILES; do basename $file .yaml done } -# Get all lines matching a node definition -function hydra_node_lines { - # See http://www.mail-archive.com/puppet-users@googlegroups.com/msg01615.html - grep ^node $FILES | sed -e 's/^node //' | awk -F, '{for(i=1;i<=NF;i++) {print $i}}' -} - -# Default node retrieval method -function hydra_nodes { - hydra_node_names -} - # Load source $APP_BASE/lib/hydra/functions || exit 1 hydra_config_load