* [Bug 931] Trex config file (yaml) will break dts with valid yaml
@ 2022-01-31 21:33 bugzilla
0 siblings, 0 replies; only message in thread
From: bugzilla @ 2022-01-31 21:33 UTC (permalink / raw)
To: dts
https://bugs.dpdk.org/show_bug.cgi?id=931
Bug ID: 931
Summary: Trex config file (yaml) will break dts with valid yaml
Product: DTS
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: framework
Assignee: dts@dpdk.org
Reporter: ohilyard@iol.unh.edu
Target Milestone: ---
framework/crb.py:503 (check_trex_process_existed)
```
if 'config_file' in conf_info:
config_file = conf_info['config_file']
else:
config_file = '/etc/trex_cfg.yaml'
fd = open(config_file, 'r')
output = fd.read()
fd.close()
prefix = re.search("prefix\s*:\s*(\S*)", output)
if prefix is not None:
self.trex_prefix = prefix.group(1)
```
This will break if quotes are used even though 'prefix: "trex1"' and 'prefix:
trex1' are semantically equivalent. An actual yaml parser should be used to
extract this information to avoid this fragility.
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-31 21:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 21:33 [Bug 931] Trex config file (yaml) will break dts with valid yaml bugzilla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).