[dvsim] Fix remaining comments from #5876
Signed-off-by: Srikrishna Iyer <sriyer@google.com>
diff --git a/util/dvsim/Deploy.py b/util/dvsim/Deploy.py
index 1264ff4..504049a 100644
--- a/util/dvsim/Deploy.py
+++ b/util/dvsim/Deploy.py
@@ -203,9 +203,9 @@
def _construct_cmd(self):
"""Construct the command that will eventually be launched."""
- args = ["make", "-f", self.flow_makefile, self.target]
+ cmd = "make -f {} {}".format(self.flow_makefile, self.target)
if self.dry_run is True:
- args += ["-n"]
+ cmd += " -n"
for attr in sorted(self.mandatory_cmd_attrs.keys()):
value = getattr(self, attr)
if type(value) is list:
@@ -217,8 +217,8 @@
value = int(value)
if type(value) is str:
value = value.strip()
- args += ["{}={}".format(attr, shlex.quote(value))]
- return " ".join(args)
+ cmd += " {}={}".format(attr, shlex.quote(value))
+ return cmd
def is_equivalent_job(self, item):
"""Checks if job that would be dispatched with 'item' is equivalent to
@@ -362,9 +362,7 @@
"report_opts": False
})
- self.mandatory_misc_attrs.update({
- "build_fail_patterns": False
- })
+ self.mandatory_misc_attrs.update({"build_fail_patterns": False})
def _set_attrs(self):
super()._extract_attrs(self.build_mode_obj.__dict__)
diff --git a/util/dvsim/LocalLauncher.py b/util/dvsim/LocalLauncher.py
index bf6c8f5..70d7839 100644
--- a/util/dvsim/LocalLauncher.py
+++ b/util/dvsim/LocalLauncher.py
@@ -42,7 +42,6 @@
self._dump_env_vars(exports)
- args = shlex.split(self.deploy.cmd)
try:
f = open(self.deploy.get_log_path(),
"w",
@@ -50,7 +49,7 @@
errors="surrogateescape")
f.write("[Executing]:\n{}\n\n".format(self.deploy.cmd))
f.flush()
- self.process = subprocess.Popen(args,
+ self.process = subprocess.Popen(shlex.split(self.deploy.cmd),
bufsize=4096,
universal_newlines=True,
stdout=f,
diff --git a/util/dvsim/utils_test.py b/util/dvsim/utils_test.py
index d8267b7..f3a0179 100644
--- a/util/dvsim/utils_test.py
+++ b/util/dvsim/utils_test.py
@@ -64,6 +64,9 @@
assert (subst_wildcards('{eval_cmd}echo foo {b}', {'b': 'bar'}) ==
'foo bar')
+ assert (subst_wildcards('foo {eval_cmd}echo {b}', {'b': 'bar'}) ==
+ 'foo bar')
+
# Make sure that nested commands work
assert (subst_wildcards('{eval_cmd} {eval_cmd} echo echo a', {}) == 'a')