Skip to content

Commit

Permalink
adding the configuration name to nanorc so shifters will know what gl…
Browse files Browse the repository at this point in the history
…obal config is being used
  • Loading branch information
TiagoTAlves committed Jul 1, 2024
1 parent 9ab42d2 commit 3c4d9ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/nanorc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def __init__(
if not use_kerb:
self.ssh_conf = ["-o GSSAPIAuthentication=no"]
self.port_offset = port_offset
self.configuration_name = top_cfg.path
self.cfg = TreeBuilder(
log=self.log,
top_cfg=top_cfg,
Expand Down Expand Up @@ -260,7 +261,7 @@ def status(self) -> NoReturn:
self.console.print('\n')
if self.runs:
print_run_info(self.runs[-1], self.console)
print_status(apparatus_id=self.apparatus_id, topnode=self.topnode, console=self.console, partition=self.partition)
print_status(apparatus_id=self.apparatus_id, topnode=self.topnode, console=self.console, partition=self.partition, conf=self.configuration_name)

def ls(self, leg:bool) -> NoReturn:
"""
Expand Down
4 changes: 2 additions & 2 deletions src/nanorc/node_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def status_data(node, get_children=True) -> dict:
return ret


def print_status(topnode, console, apparatus_id='', partition='') -> int:
table = Table(title=f"[bold]{apparatus_id}[/bold] applications" + (f" in partition [bold]{partition}[/bold]" if partition else ''))
def print_status(topnode, console, apparatus_id='', partition='', conf='') -> int:
table = Table(title=f"[bold]{apparatus_id}[/bold] applications" + (f" in partition [bold]{partition}[/bold]" + (f" running using [bold]{conf}[/bold] configuration" if partition else '')))
table.add_column("name", style="blue")
table.add_column("state", style="blue")
table.add_column("host", style="magenta")
Expand Down

0 comments on commit 3c4d9ed

Please sign in to comment.