Skip to content

Commit

Permalink
Do config reload in neuro config show (#2728)
Browse files Browse the repository at this point in the history
* Do config reload in neuro config show

* Add changelog
  • Loading branch information
romasku authored Jun 9, 2022
1 parent 3231df3 commit a7ab936
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.D/2728.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Re-load clusters config in `neuro config show`.
14 changes: 10 additions & 4 deletions neuro-cli/src/neuro_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@ async def show(root: Root) -> None:
"""
Print current settings.
"""

with root.status("Fetching the current config"):
await root.client.config.fetch()
cluster_name = root.client.config.cluster_name
fmt = ConfigFormatter()
try:
jobs_capacity = await root.client.jobs.get_capacity(cluster_name=cluster_name)
except (ClientConnectionError, AuthorizationError):
jobs_capacity = {}
with root.status("Fetching the jobs capacity"):
try:
jobs_capacity = await root.client.jobs.get_capacity(
cluster_name=cluster_name
)
except (ClientConnectionError, AuthorizationError):
jobs_capacity = {}
quota = await root.client.users.get_quota()
org_quota = await root.client.users.get_org_quota()
root.print(fmt(root.client.config, jobs_capacity, quota, org_quota))
Expand Down

0 comments on commit a7ab936

Please sign in to comment.