Skip to content

Commit a863312

Browse files
committed
Fix for past revisions
1 parent 58fdb99 commit a863312

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/cli/config.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import enum
2121
import json
2222
import subprocess
23-
import sys
2423
from typing import Any, Dict, Literal, Set, TypedDict
2524

2625
from src.cli import editor
@@ -357,6 +356,10 @@ def _run_show_command(service_client: client.ServiceClient, args: argparse.Names
357356
# Parse the config identifier
358357
if ':' in args.config:
359358
# Format is <CONFIG_TYPE>:<revision>
359+
if args.verbose:
360+
raise osmo_errors.OSMOUserError(
361+
'--verbose is not supported for historical revisions'
362+
)
360363
revision = config_history.ConfigHistoryRevision(args.config)
361364
params: Dict[str, Any] = {
362365
'config_types': [revision.config_type.value],
@@ -375,12 +378,11 @@ def _run_show_command(service_client: client.ServiceClient, args: argparse.Names
375378
data = result['configs'][0]['data']
376379
else:
377380
# Format is <CONFIG_TYPE>
378-
verbose = args.verbose
379-
if verbose and args.config != config_history.ConfigHistoryType.POOL.value:
380-
print(f'Warning: --verbose is only supported for POOL configs, ignoring for {args.config}',
381-
file=sys.stderr)
382-
verbose = False
383-
request_params: Dict[str, Any] | None = {'verbose': True} if verbose else None
381+
if args.verbose and args.config != config_history.ConfigHistoryType.POOL.value:
382+
raise osmo_errors.OSMOUserError(
383+
f'--verbose is only supported for POOL configs, not {args.config}'
384+
)
385+
request_params: Dict[str, Any] | None = {'verbose': True} if args.verbose else None
384386
data = _get_current_config(service_client, args.config, params=request_params)
385387

386388
# Handle multiple name arguments for indexing

0 commit comments

Comments
 (0)