From a5a89d49888aa6123b78c37b72ec34177f40dcaf Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 18 Sep 2013 16:51:04 +0200 Subject: use curl -f instead of curl | grep -v "error" curl -f will fail if a 400 or 500 response code is returned --- manifests/document.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests/document.pp') diff --git a/manifests/document.pp b/manifests/document.pp index 2f6aac6..1153296 100644 --- a/manifests/document.pp +++ b/manifests/document.pp @@ -28,7 +28,7 @@ define couchdb::document( cmd => 'PUT', host => $host, path => "${db}/${id}", - unless => "/usr/bin/curl -s --netrc-file /etc/couchdb/couchdb.netrc ${url} | grep -q -v '{\"error\":'" + unless => "/usr/bin/curl -s -f --netrc-file /etc/couchdb/couchdb.netrc ${url}" } } @@ -37,7 +37,7 @@ define couchdb::document( cmd => 'DELETE', host => $host, path => "${db}/${id}", - unless => "/usr/bin/curl -s --netrc-file /etc/couchdb/couchdb.netrc ${url} | grep -q '{\"error\":'" + unless => "/usr/bin/curl -s -f --netrc-file /etc/couchdb/couchdb.netrc ${url}" } } } -- cgit v1.2.3