google / google/openhtf

Get endpoint for phase descriptors fails

Open
#972 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
722
Forks
237
Avg merge
11h 31m
Merged PRs (30d)
4

Description

Using frontend_example.py, the web gui issues an HTTP error. I have tracked it down to the GET of phase groups. See code below. test.descriptor.phase_group does not exists at that time it is read.

Replacing line 360 with phase_descriptors = [] solves the HTTP error in the web gui showing that the initialisation of that array is the issue, but obviously is not a fix!

At that time, test.descriptor.phase_sequence.nodes exists, but does not work as a suitable replacement for phase_group. The exception is gone, but the HTTP response error still occurs.

Line 351 of station_server.py ...
```
class PhasesHandler(BaseTestHandler):
"""GET endpoint for phase descriptors for a test, i.e. the full phase list."""

def get(self, test_uid):
test, _ = self.get_test(test_uid)

if test is None:
return

phase_descriptors = [
dict(id=id(phase), **data.convert_to_base_types(phase))
for phase in test.descriptor.phase_group
]

# Wrap value in a dict because writing a list directly is prohibited.
self.write({'data': phase_descriptors})
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.