Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Commit

Permalink
Merge 5ed7871 into 9f106bb
Browse files Browse the repository at this point in the history
  • Loading branch information
goruck committed Jun 18, 2017
2 parents 9f106bb + 5ed7871 commit cf66cd6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions openag/cli/db/__init__.py
Expand Up @@ -54,14 +54,16 @@ def init(db_url, api_url):
url = urljoin(server.resource.url, "_config", section, param)
try:
current_val = server.resource.session.request(
"GET", url
"GET", url, body=None, headers=None,
credentials=server.resource.credentials
)[2].read().strip()
except ResourceNotFound:
current_val = None
desired_val = '"{}"'.format(value.replace('"', '\\"'))
if current_val != desired_val:
status = server.resource.session.request(
"PUT", url, body=desired_val
"PUT", url, body=desired_val, headers=None,
credentials=server.resource.credentials
)[0]
# Unless there is some delay between requests, CouchDB gets
# sad for some reason
Expand Down

0 comments on commit cf66cd6

Please sign in to comment.