Add HTTP code 204 to the accepted codes 35/83035/5
authorLuis Gomez <ecelgp@gmail.com>
Fri, 12 Jul 2019 23:29:27 +0000 (16:29 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Sat, 13 Jul 2019 01:05:13 +0000 (18:05 -0700)
A test is failing because the below RPC now returns 204:

POST operations/network-topology-pcep:update-lsp

Change-Id: I24fb5821cb194d492ec11c5824991b70c91be868
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
tools/pcep_updater/updater.py

index 95c2fb87da430da1edded201c632417e7e1f22d6..e5a0c427447b741c4739f1bd45f86a020777ed84 100644 (file)
@@ -151,12 +151,12 @@ def classify(resp_tuple):
     prepend = ''
     status = resp_tuple[0]
     # print 'DEBUG: verifying status', status
-    if status != 200:  # is it int?
+    if (status != 200) and (status != 204):  # is it int?
         # print 'DEBUG:', response.content
         prepend = 'status: ' + str(status) + ' '
     content = resp_tuple[1]
     # print 'DEBUG: verifying content', content
-    if prepend or (content != expected):
+    if prepend or (content != expected and content != ''):
         return prepend + 'content: ' + str(content)
     return 'pass'