Commit 6ac8ff5 1 parent 421bacf commit 6ac8ff5 Copy full SHA for 6ac8ff5
File tree 1 file changed +10
-4
lines changed
diracx-cli/src/diracx/cli/internal
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 3
3
import json
4
4
import os
5
5
from pathlib import Path
6
- from typing import cast
6
+ from typing import TYPE_CHECKING , cast
7
7
from urllib .parse import urljoin , urlparse
8
8
9
9
import diraccfg
10
10
import typer
11
11
import yaml
12
+
13
+ if TYPE_CHECKING :
14
+ from diraccfg .cfg import CFGAsDict
15
+
12
16
from pydantic import BaseModel
13
17
from typer import Option
14
18
@@ -59,12 +63,14 @@ def cs_sync(old_file: Path, new_file: Path):
59
63
cfg = diraccfg .CFG ().loadFromBuffer (old_data )
60
64
raw = cfg .getAsDict ()
61
65
62
- diracx_section = raw ["DiracX" ]
66
+ diracx_section = cast ( "CFGAsDict" , raw ["DiracX" ])
63
67
# DisabledVOs cannot be set if any Legacy clients are enabled
64
68
disabled_vos = diracx_section .get ("DisabledVOs" )
65
69
enabled_clients = []
66
- for _ , client_status in diracx_section .get ("LegacyClientEnabled" , {}).items ():
67
- for _ , str_status in client_status .items ():
70
+ for _ , client_status in cast (
71
+ "CFGAsDict" , diracx_section .get ("LegacyClientEnabled" , {})
72
+ ).items ():
73
+ for _ , str_status in cast ("CFGAsDict" , client_status ).items ():
68
74
enabled_clients .append (str_status == "True" )
69
75
if disabled_vos and any (enabled_clients ):
70
76
raise RuntimeError (
You can’t perform that action at this time.
0 commit comments