New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy _security object in couchup; python3 fix #1721

Merged
merged 2 commits into from Nov 7, 2018

Conversation

Projects
None yet
3 participants
@wohali
Member

wohali commented Nov 7, 2018

Fixes #1604.

@wohali wohali requested review from janl and nickva Nov 7, 2018

@@ -172,6 +172,25 @@ def _put_filter(args, db=None):
print(exc.response.text)
exit(1)
def _do_security(args, db=None):

This comment has been minimized.

@nickva

nickva Nov 7, 2018

Contributor

Would db=None work?

This comment has been minimized.

@wohali

wohali Nov 7, 2018

Member

No, but some of the other functions that have the same calling function also don't check this parameter, see _put_filter for instance.

So that's not great, BUT if you look down at _replicate, it's doing a for db in dbs so a None shouldn't end up in that list anyway.

You're welcome to improve the code if you like in a new PR 😄

@davisp

This comment has been minimized.

Member

davisp commented Nov 7, 2018

+1

req = requests.put(
'http://127.0.0.1:{}/{}/_security'.format(
args['clustered_port'], db),
data=json.dumps(security_doc),

This comment has been minimized.

@nickva

nickva Nov 7, 2018

Contributor

Do we need to set headers = {'Content-type': 'application/json'}

This comment has been minimized.

@wohali

wohali Nov 7, 2018

Member

@nickva requests automatically does this for us ❤️ I actually tested the code.

@wohali wohali merged commit 33c39a9 into master Nov 7, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@wohali wohali deleted the 1604-couchup-security branch Nov 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment