Skip to content

Commit c0ff852

Browse files
committed
Corrected issue with check for wrong status code for deletes.
1 parent 89143bd commit c0ff852

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

CHANGES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
osdf-python 0.2.2
2+
3+
* Correct check for wrong HTTP status code on deletes.
4+
5+
- Victor <victor73@github.com> Wed, 24 Jun 2015 12:00:00 -0400
6+
17
osdf-python 0.2.1
28

39
* Corrected issue with property get/set not being honored.

osdf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ def delete_node(self, node_id):
205205
"""
206206
osdf_response = self._request.delete("/nodes/" + node_id)
207207

208-
if osdf_response['code'] != 200:
208+
headers = osdf_response["headers"]
209+
210+
if osdf_response['code'] != 204:
209211
if 'x-osdf-error' in headers:
210212
msg = "Unable to delete node document. Reason: " + headers['x-osdf-error']
211213
else:

request.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def delete(self, resource):
2929
resp = conn.getresponse()
3030
content = resp.read()
3131

32+
headers = {}
3233
raw_headers = resp.getheaders()
3334

3435
for header in raw_headers:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def read(fname):
88
setup(name='osdf-python',
99
description='Python client to Open Science Data Framework (OSDF) REST servers.',
1010
long_description=read('README.md'),
11-
version='0.2.1',
11+
version='0.2.2',
1212
py_modules=['osdf', 'request'],
1313
author='Victor Felix',
1414
author_email='victor73@gmail.com',

0 commit comments

Comments
 (0)