diff options
author | Azul <azul@riseup.net> | 2013-08-15 12:52:45 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2013-08-28 12:52:35 +0200 |
commit | 8a0f585cbdb8f54d495f636e36b812a3d5b8b804 (patch) | |
tree | 6892cea9b2064ae3ee0c829417e07e1984959376 /files/couch-doc-update | |
parent | 16a3583c359cd57ff52866a8dfd933726d120d30 (diff) |
use couchdb::document to create bigcouch node config (feature #3485)
fixes the use of couch-doc-update with non standart hosts
replaces couchdb::bigcouch::query with couchdb::bigcouch::document
Diffstat (limited to 'files/couch-doc-update')
-rw-r--r-- | files/couch-doc-update | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/files/couch-doc-update b/files/couch-doc-update index e4adfbe..3cdf6ce 100644 --- a/files/couch-doc-update +++ b/files/couch-doc-update @@ -35,7 +35,7 @@ def main # # parse options # - @host = "127.0.0.1:5984" + @host = nil @db_name = nil @doc_id = nil @new_data = nil @@ -102,12 +102,14 @@ def connection_string(database, host) netrc.scan(/\w+ [\w\.]+/).each do |key_value| key, value = key_value.split ' ' case key - when "machine" then host = value + ':' + port + when "machine" then host ||= value + ':' + port when "login" then username = value when "password" then password = value end end + host ||= '127.0.0.1:5984' + "%s://%s:%s@%s/%s" % [protocol, username, password, host, database] end |