fix issue with a module based on a SEA subobject

Change-Id: I15102ef0e17cd4414e8699e2967292b3853d2ac0
This commit is contained in:
zolliker 2021-04-27 15:57:57 +02:00
parent 3977fad3f3
commit c6157049d7

View File

@ -325,6 +325,22 @@ class SeaConfigCreator(SeaClient):
result.append('%s: %s' % (filename, ','.join(n for n in descr)))
raise SystemExit('; '.join(result))
@Command(StringType(), result=StringType())
def query(self, cmd):
"""a request checking for errors and accepting 0 or 1 line as result"""
errors = []
reply = None
for line in self.request(cmd).split('\n'):
if line.strip().startswith('ERROR:'):
errors.append(line[6:].strip())
elif reply is None:
reply = line.strip()
else:
self.log.info('SEA: superfluous reply %r to %r', reply, cmd)
if errors:
raise HardwareError('; '.join(errors))
return reply
SEA_TO_SECOPTYPE = {
'float': FloatRange(),