Skip to content

Commit

Permalink
fixed missing json output of mona list
Browse files Browse the repository at this point in the history
  • Loading branch information
mdorier committed Feb 5, 2024
1 parent e06131a commit 1850943
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/mochi/bedrock/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,7 @@ def to_dict(self) -> dict:
data = {'margo': self.margo.to_dict(),
'abt_io': [a.to_dict() for a in self._abt_io],
'ssg': [g.to_dict() for g in self._ssg],
'mona': [m.to_dict() for m in self._mona],
'libraries': self.libraries,
'providers': [p.to_dict() for p in self._providers],
'clients': [c.to_dict() for c in self._clients],
Expand All @@ -1665,6 +1666,7 @@ def from_dict(data: dict) -> 'ProcSpec':
"""
margo = MargoSpec.from_dict(data['margo'])
abt_io = []
mona = []
ssg = []
libraries = dict()
providers = []
Expand All @@ -1678,6 +1680,9 @@ def from_dict(data: dict) -> 'ProcSpec':
if 'ssg' in data:
for g in data['ssg']:
ssg.append(SSGSpec.from_dict(g, margo.argobots))
if 'mona' in data:
for m in data['mona']:
mona.append(MonaSpec.from_dict(m, margo.argobots))
if 'providers' in data:
for p in data['providers']:
providers.append(ProviderSpec.from_dict(p, margo.argobots))
Expand All @@ -1689,6 +1694,7 @@ def from_dict(data: dict) -> 'ProcSpec':
return ProcSpec(margo=margo,
abt_io=abt_io,
ssg=ssg,
mona=mona,
libraries=libraries,
providers=providers,
clients=clients,
Expand All @@ -1714,6 +1720,11 @@ def validate(self) -> NoReturn:
if p not in self.margo.argobots.pools:
raise ValueError(f'Pool "{p.name}" used by ABT-IO instance' +
' not found in margo.argobots.pools')
for m in self._mona:
p = m.pool
if p not in self.margo.argobots.pools:
raise ValueError(f'Pool "{p.name}" used by MoNA instance' +
' not found in margo.argobots.pools')
for g in self._ssg:
p = g.pool
if p not in self.margo.argobots.pools:
Expand Down

0 comments on commit 1850943

Please sign in to comment.