summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2013-08-28 12:47:40 +0200
committerAzul <azul@riseup.net>2013-08-28 12:53:12 +0200
commit321d463b43dc44a4f313aa6dabef1a8bdce27122 (patch)
treea43904f36314fada40892c75b2ffa88c57a36dce
parent8a0f585cbdb8f54d495f636e36b812a3d5b8b804 (diff)
minor: cleanup spacing (feature #3485)
-rw-r--r--files/couch-doc-update2
-rw-r--r--manifests/document.pp19
2 files changed, 13 insertions, 8 deletions
diff --git a/files/couch-doc-update b/files/couch-doc-update
index 3cdf6ce..f448046 100644
--- a/files/couch-doc-update
+++ b/files/couch-doc-update
@@ -51,7 +51,7 @@ def main
end
usage("Missing required option") unless @db_name && @doc_id && @new_data
@new_data = JSON.parse(@new_data)
-
+
#
# update document
#
diff --git a/manifests/document.pp b/manifests/document.pp
index afbd37a..77296dc 100644
--- a/manifests/document.pp
+++ b/manifests/document.pp
@@ -5,7 +5,12 @@
# ensure => {absent,present,*content*}
# }
#
-define couchdb::document ( $host='127.0.0.1:5984', $db, $id, $data='{}', $ensure='content') {
+define couchdb::document(
+ $db,
+ $id,
+ $host = '127.0.0.1:5984',
+ $data = '{}',
+ $ensure = 'content') {
$url = "${host}/${db}/${id}"
@@ -20,18 +25,18 @@ define couchdb::document ( $host='127.0.0.1:5984', $db, $id, $data='{}', $ensure
present: {
couchdb::query { "create_${db}_${id}":
- cmd => 'PUT',
- host => $host,
- path => "${db}/${id}",
+ cmd => 'PUT',
+ host => $host,
+ path => "${db}/${id}",
unless => "/usr/bin/curl --netrc-file /etc/couchdb/couchdb.netrc ${url}"
}
}
absent: {
couchdb::query { "destroy_${db}_${id}":
- cmd => 'DELETE',
- host => $host,
- path => "${db}/${id}",
+ cmd => 'DELETE',
+ host => $host,
+ path => "${db}/${id}",
onlyif => "/usr/bin/curl --netrc-file /etc/couchdb/couchdb.netrc ${url}"
}
}