mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-04-20 09:40:50 +01:00
FilePoller: Made files
a mandatory parameter.
Changed the `files` parameter to be mandatory and added check to ensure that at least one file is passed in configuration otherwise the instrument crashes.
This commit is contained in:
parent
33dae51536
commit
d88d35be26
@ -35,7 +35,7 @@ class FilePoller(Instrument):
|
|||||||
parameters = [
|
parameters = [
|
||||||
Parameter('sample_interval', kind=int, default=1000,
|
Parameter('sample_interval', kind=int, default=1000,
|
||||||
description="""The interval between samples in mS."""),
|
description="""The interval between samples in mS."""),
|
||||||
Parameter('files', kind=list_or_string,
|
Parameter('files', kind=list_or_string, mandatory=True,
|
||||||
description="""A list of paths to the files to be polled"""),
|
description="""A list of paths to the files to be polled"""),
|
||||||
Parameter('labels', kind=list_or_string,
|
Parameter('labels', kind=list_or_string,
|
||||||
description="""A list of lables to be used in the CSV output for
|
description="""A list of lables to be used in the CSV output for
|
||||||
@ -49,6 +49,8 @@ class FilePoller(Instrument):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
|
if not self.files:
|
||||||
|
raise ConfigError('You must specify atleast one file to poll')
|
||||||
if self.labels and any(['*' in f for f in self.files]):
|
if self.labels and any(['*' in f for f in self.files]):
|
||||||
raise ConfigError('You cannot used manual labels with `*` wildcards')
|
raise ConfigError('You cannot used manual labels with `*` wildcards')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user