Skip to content

Commit e729458

Browse files
debug
1 parent 62dad06 commit e729458

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

vre-singleuser-swan-cern/scripts/others/configure_rucio_jupyterlab.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
import json
66

77
def write_jupyterlab_config():
8-
dir_config_jupyterlab = os.getenv('JUPYTER_CONFIG_DIR',
9-
os.path.join(os.getenv('HOME'), '.jupyter')
10-
)
11-
file_server_config = os.path.join(dir_config_jupyterlab, 'jupyter_server_config.json')
8+
config_jupyterlab = os.environ['JUPYTER_CONFIG_DIR']
9+
file_path = config_jupyterlab + '/jupyter_server_config.json'
1210

13-
if not os.path.exists(dir_config_jupyterlab):
14-
os.makedirs( dir_config_jupyterlab, exist_ok=True)
15-
elif os.path.isfile(file_server_config) :
16-
with open(file_server_config, "r") as config_file:
17-
config_payload = config_file.read()
11+
if not os.path.isfile(file_path):
12+
os.makedirs( config_jupyterlab + '/.jupyter/', exist_ok=True)
13+
else:
14+
config_file = open(file_path, 'r')
15+
config_payload = config_file.read()
16+
config_file.close()
1817

1918
try:
2019
config_json = json.loads(config_payload)
@@ -89,14 +88,15 @@ def write_jupyterlab_config():
8988
v in atlas_config.items() if v is not None}
9089

9190
config_json['RucioConfig'] = {
92-
'instances': [escape_config], # atlas, cms,
91+
'instances': [escape_config, atlas_config], # cms,
9392
"default_instance": os.getenv('RUCIO_DEFAULT_INSTANCE', escape_config['name']),
9493
"default_auth_type": os.getenv('RUCIO_DEFAULT_AUTH_TYPE', 'x509_proxy'),
9594
}
9695

97-
config_file = open(file_server_config, 'w')
96+
config_file = open(file_path, 'w')
9897
config_file.write(json.dumps(config_json, indent=2))
9998
config_file.close()
99+
100100

101101
# def write_rucio_config():
102102

0 commit comments

Comments
 (0)