Skip to content

Commit

Permalink
Merge pull request #230 from Kegeruneku/ust_3139/dev/3969_move_broken…
Browse files Browse the repository at this point in the history
…_inventories_to_graveyard

Fixes #3969: (DEVELOPMENT) Move failing inventories to the right directo...
  • Loading branch information
Kegeruneku committed Oct 21, 2013
2 parents 71e04a6 + a6dc9e0 commit 803ad72
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Expand Up @@ -85,20 +85,19 @@ bundle agent sendInventoryToCmdb
root_server::

"${g.rudder_inventories}/incoming"
transformer => "${g.rudder_dependencies}/send-clean.sh http://localhost:8080/endpoint/upload/ ${this.promiser} ${g.rudder_inventories}/received/",
transformer => "${g.rudder_dependencies}/send-clean.sh http://localhost:8080/endpoint/upload/ ${this.promiser} ${g.rudder_inventories}/received/ ${g.rudder_inventories}/failed/",
depth_search => recurse_visible(1),
file_select => all_files,
classes => if_else("inventory_sent", "rudder_send_inventory_to_cmdb_cant_send_inventory"),
comment => "Sending the inventory to the cmdb";

"${g.rudder_inventories}/accepted-nodes-updates"
transformer => "${g.rudder_dependencies}/send-clean.sh http://localhost:8080/endpoint/upload/ ${this.promiser} ${g.rudder_inventories}/received/",
transformer => "${g.rudder_dependencies}/send-clean.sh http://localhost:8080/endpoint/upload/ ${this.promiser} ${g.rudder_inventories}/received/ ${g.rudder_inventories}/failed/",
depth_search => recurse_visible(1),
file_select => all_files,
classes => if_else("inventory_sent", "rudder_send_inventory_to_cmdb_cant_send_inventory"),
comment => "Sending the inventory to the cmdb";


# NEED TO DO THE RSYNC PART

reports:
Expand Down
Expand Up @@ -83,13 +83,12 @@ bundle agent sendInventoryToCmdb
files:
root_server::
"${g.rudder_inventories}/incoming"
transformer => "${g.rudder_dependencies}/send-clean.sh http://localhost:8080/endpoint/upload/ ${this.promiser} ${g.rudder_inventories}/received/",
transformer => "${g.rudder_dependencies}/send-clean.sh http://localhost:8080/endpoint/upload/ ${this.promiser} ${g.rudder_inventories}/received/ ${g.rudder_inventories}/failed/",
depth_search => recurse_visible(1),
file_select => all_files,
classes => if_else("inventory_sent", "cant_send_inventory"),
comment => "Sending the inventory to the cmdb";


# NEED TO DO THE RSYNC PART

reports:
Expand Down
Expand Up @@ -108,7 +108,7 @@ bundle agent sendInventoryToCmdb
root_server::

"${g.rudder_inventories}/${inventory_folders}"
transformer => "${g.rudder_dependencies}/send-clean.sh &CMDBENDPOINT& ${this.promiser} ${g.rudder_inventories}/received/",
transformer => "${g.rudder_dependencies}/send-clean.sh &CMDBENDPOINT& ${this.promiser} ${g.rudder_inventories}/received/ ${g.rudder_inventories}/failed/",
depth_search => recurse_visible(1),
file_select => all_files,
classes => rudder_common_classes("rudder_inventory_processing"),
Expand Down
3 changes: 3 additions & 0 deletions tools/send-clean.sh
Expand Up @@ -26,6 +26,8 @@ fi
SERVER=$1
FILENAME=$2
ARCHIVEDIR=$3
FAILEDDIR=$4
BASENAME=$(basename ${2})
CURL_BINARY="/usr/bin/curl"

# Attempt to send the file
Expand All @@ -34,6 +36,7 @@ SEND_COMMAND_RET=$?

# Abort if sending failed
if [ ${SEND_COMMAND_RET} -ne 0 ]; then
mv "${FILENAME}" "${FAILEDDIR}/${BASENAME}-$(date --rfc-3339=date)"
exit ${SEND_COMMAND_RET}
fi

Expand Down

0 comments on commit 803ad72

Please sign in to comment.