diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2022-06-20 15:55:42 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2022-06-20 15:55:42 +0200 |
commit | c9097d5f6346271e3f3c5198cda0901d5a979776 (patch) | |
tree | f725761be1e87d4bb2a2bf7d3a7c5434b9c4cb5e /lib | |
parent | ee4c5d3cd512e905fce230965e9e7836015fa30e (diff) |
runner: add get_nfpvalues helper
Diffstat (limited to 'lib')
-rw-r--r-- | lib/runner.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/runner.py b/lib/runner.py index 3290913..a8c2fd1 100644 --- a/lib/runner.py +++ b/lib/runner.py @@ -522,6 +522,24 @@ class KRATOS: max_overflow, ) + def get_nfpvalues(self) -> list: + """ + Return Kratos "make nfpvalues" output. + + Returns a dict. + """ + command = ["make", "nfpvalues"] + logger.debug(f"Getting nfpvalues: {' '.join(command)}") + res = subprocess.run( + command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, + ) + if res.returncode != 0: + raise RuntimeError(f"make nfpvalues Failure. command = {command}") + return json.loads(res.stdout) + class Multipass: def __init__(self, name, opts=list()): @@ -655,6 +673,26 @@ class Multipass: raise RuntimeError(f"make info Failure. command = {command}") return res.stdout.split("\n") + def get_nfpvalues(self, app, opts=list()) -> list: + """ + Return multipass "make nfpvalues" output. + + Returns a dict. + """ + command = ["make", f"arch={self.name}", f"app={app}", "nfpvalues"] + command.extend(self.opts) + command.extend(opts) + logger.debug(f"Getting nfpvalues: {' '.join(command)}") + res = subprocess.run( + command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, + ) + if res.returncode != 0: + raise RuntimeError(f"make nfpvalues Failure. command = {command}") + return json.loads(res.stdout) + def _cached_info(self, opts=list()) -> list: if len(opts): return self.get_info(opts) |