Skip to content
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

client.write() returns 204 #34

Closed
frodopwns opened this issue Jan 23, 2016 · 3 comments
Closed

client.write() returns 204 #34

frodopwns opened this issue Jan 23, 2016 · 3 comments

Comments

@frodopwns
Copy link

In vault 0.4.0 I am getting 204 return codes from client.write() instead of 200.

Because of this check: https://github.com/ianunruh/hvac/blob/master/hvac/v1/__init__.py#L35

None is returned for both success and failure.

frodopwns pushed a commit to frodopwns/hvac that referenced this issue Jan 23, 2016
@ianunruh
Copy link
Member

This is expected behavior. If the write failed, then an exception would be thrown due to a non-200 response code. Returning None for 204 No Content seems reasonable to me.

@frodopwns
Copy link
Author

What is the point of this then?

 if response.status_code == 200:
            return response.json()

@ianunruh
Copy link
Member

Only some writes return content. For example, a write to the generic secret backend will return nothing and a 204 No Content status code. But a write to the PKI secret backend to issue a certificate will return JSON about the new certificate and a 200 OK status code.

It is up to the caller to know if there will be content from the write call they make.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants