Browse Source

server: always return None instead of sometimes returning "ok"

Previously some functions returned the string "ok".
tags/nilmdb-1.1^2
Jim Paris 11 years ago
parent
commit
e19da84b2e
3 changed files with 2 additions and 5 deletions
  1. +1
    -1
      nilmdb/server/nilmdb.py
  2. +1
    -3
      nilmdb/server/server.py
  3. +0
    -1
      tests/test_client.py

+ 1
- 1
nilmdb/server/nilmdb.py View File

@@ -417,7 +417,7 @@ class NilmDB(object):
self._add_interval(stream_id, interval, row_start, row_end) self._add_interval(stream_id, interval, row_start, row_end)


# And that's all # And that's all
return "ok"
return


def _find_start(self, table, dbinterval): def _find_start(self, table, dbinterval):
""" """


+ 1
- 3
nilmdb/server/server.py View File

@@ -177,7 +177,6 @@ class Stream(NilmApp):
dictionary""" dictionary"""
data_dict = json.loads(data) data_dict = json.loads(data)
self.db.stream_set_metadata(path, data_dict) self.db.stream_set_metadata(path, data_dict)
return "ok"


# /stream/update_metadata?path=/newton/prep&data=<json> # /stream/update_metadata?path=/newton/prep&data=<json>
@cherrypy.expose @cherrypy.expose
@@ -188,7 +187,6 @@ class Stream(NilmApp):
should be a json-encoded dictionary""" should be a json-encoded dictionary"""
data_dict = json.loads(data) data_dict = json.loads(data)
self.db.stream_update_metadata(path, data_dict) self.db.stream_update_metadata(path, data_dict)
return "ok"


# /stream/insert?path=/newton/prep # /stream/insert?path=/newton/prep
@cherrypy.expose @cherrypy.expose
@@ -247,7 +245,7 @@ class Stream(NilmApp):
raise cherrypy.HTTPError("400 Bad Request", e.message) raise cherrypy.HTTPError("400 Bad Request", e.message)


# Done # Done
return "ok"
return


# /stream/remove?path=/newton/prep # /stream/remove?path=/newton/prep
# /stream/remove?path=/newton/prep&start=1234567890.0&end=1234567899.0 # /stream/remove?path=/newton/prep&start=1234567890.0&end=1234567899.0


+ 0
- 1
tests/test_client.py View File

@@ -220,7 +220,6 @@ class TestClient(object):
data = timestamper.TimestamperRate(testfile, start, 120) data = timestamper.TimestamperRate(testfile, start, 120)
result = client.stream_insert("/newton/prep", data, result = client.stream_insert("/newton/prep", data,
start, start + 119.999777) start, start + 119.999777)
eq_(result, "ok")


# Verify the intervals. Should be just one, even if the data # Verify the intervals. Should be just one, even if the data
# was inserted in chunks, due to nilmdb interval concatenation. # was inserted in chunks, due to nilmdb interval concatenation.


Loading…
Cancel
Save