Ignore GetParameterValues errors during initialization step
This commit is contained in:
1 parent
22ed899657
commit
5ba4dce248
2 files changed
+10
-6
No files matched your search
+1
-1
@@ -106,6 +106,7 @@ runTask = (currentRequest, task, methodResponse) ->
|
|||||||
nextTask(currentRequest)
|
nextTask(currentRequest)
|
||||||
)
|
)
|
||||||
when tasks.STATUS_FAULT
|
when tasks.STATUS_FAULT
|
||||||
|
util.log("#{currentRequest.deviceId}: Fault response for task #{taskId}")
|
||||||
db.saveTask(task, (err) ->
|
db.saveTask(task, (err) ->
|
||||||
# Faulty task. No more work to do until task is deleted.
|
# Faulty task. No more work to do until task is deleted.
|
||||||
res = tr069.response(null, cwmpResponse)
|
res = tr069.response(null, cwmpResponse)
|
||||||
@@ -261,7 +262,6 @@ else
|
|||||||
)
|
)
|
||||||
else if cwmpRequest.fault?
|
else if cwmpRequest.fault?
|
||||||
taskId = cwmpRequest.id
|
taskId = cwmpRequest.id
|
||||||
util.log("#{currentRequest.deviceId}: Fault response for task #{taskId}")
|
|
||||||
|
|
||||||
db.getTask(taskId, (task) ->
|
db.getTask(taskId, (task) ->
|
||||||
if not task
|
if not task
|
||||||
|
|||||||
+9
-5
@@ -9,14 +9,14 @@ exports.STATUS_FINISHED = STATUS_FINISHED = 4
|
|||||||
|
|
||||||
|
|
||||||
this.init = (task, methodResponse, cwmpResponse, deviceUpdates) ->
|
this.init = (task, methodResponse, cwmpResponse, deviceUpdates) ->
|
||||||
if methodResponse.faultcode?
|
|
||||||
task.fault = methodResponse
|
|
||||||
return STATUS_FAULT
|
|
||||||
|
|
||||||
if not task.subtask?
|
if not task.subtask?
|
||||||
task.subtask = {'name' : 'getParameterNames', 'parameterPath' : '', 'nextLevel' : false}
|
task.subtask = {'name' : 'getParameterNames', 'parameterPath' : '', 'nextLevel' : false}
|
||||||
|
|
||||||
if task.subtask.name == 'getParameterNames'
|
if task.subtask.name == 'getParameterNames'
|
||||||
|
if methodResponse.faultcode?
|
||||||
|
task.fault = methodResponse
|
||||||
|
return STATUS_FAULT
|
||||||
|
|
||||||
status = this.getParameterNames(task.subtask, methodResponse, cwmpResponse, deviceUpdates)
|
status = this.getParameterNames(task.subtask, methodResponse, cwmpResponse, deviceUpdates)
|
||||||
if status is STATUS_FINISHED
|
if status is STATUS_FINISHED
|
||||||
parameterNames = []
|
parameterNames = []
|
||||||
@@ -28,10 +28,14 @@ this.init = (task, methodResponse, cwmpResponse, deviceUpdates) ->
|
|||||||
throw Error('Unexpected subtask status')
|
throw Error('Unexpected subtask status')
|
||||||
|
|
||||||
if task.subtask.name == 'getParameterValues'
|
if task.subtask.name == 'getParameterValues'
|
||||||
|
if methodResponse.faultcode?
|
||||||
|
# Ignore GetParameterValues errors. A workaround for the crappy Seewon devices.
|
||||||
|
status = this.getParameterValues(task.subtask, {parameterList : {}}, cwmpResponse, deviceUpdates)
|
||||||
|
else
|
||||||
status = this.getParameterValues(task.subtask, methodResponse, cwmpResponse, deviceUpdates)
|
status = this.getParameterValues(task.subtask, methodResponse, cwmpResponse, deviceUpdates)
|
||||||
if status is STATUS_FINISHED
|
if status is STATUS_FINISHED
|
||||||
return STATUS_FINISHED
|
return STATUS_FINISHED
|
||||||
else if status is not STATUS_STARTED
|
else if status isnt STATUS_STARTED
|
||||||
throw Error('Unexpected subtask status')
|
throw Error('Unexpected subtask status')
|
||||||
|
|
||||||
return STATUS_STARTED
|
return STATUS_STARTED
|
||||||
|
|||||||
Reference in new issue
Block a user