Skip to content

swancontents: Fix preferred_dir interaction with SWAN_projects#490

Merged
rodrigo-sobral merged 1 commit into
swan-cern:masterfrom
tomasr8:fix-root-dir
Jun 12, 2026
Merged

swancontents: Fix preferred_dir interaction with SWAN_projects#490
rodrigo-sobral merged 1 commit into
swan-cern:masterfrom
tomasr8:fix-root-dir

Conversation

@tomasr8

@tomasr8 tomasr8 commented Jun 12, 2026

Copy link
Copy Markdown
Member

SWAN_projects is a special folder in both the classic UI and JupyterLab. Users cannot create and/or rename folders with that name. This was previously enforced with some logic relying on root_dir where the hidden assumption was that root_dir matches $HOME. This is not the case in JupyterLab where root_dir is set to /eos and preferred_dir is used in conjunction.

The effect was that in JupyterLab it is not possible to rename files inside SWAN_projects. It is also not possible to download files from anywhere.

The fix is to define a new propety swan_home which always resolves to the user home.

SWAN_projects is a special folder in both the classic UI and
JupyterLab. Users cannot create and/or rename folders with that
name. This was previously enforced with some logic relying on
`root_dir` where the hidden assumption was that `root_dir`
matches $HOME. This is not the case in JupyterLab where `root_dir`
is set to `/eos` and `preferred_dir` is used in conjunction.

The effect was that in JupyterLab it is not possible to rename
files inside SWAN_projects. It is also not possible to download
files from anywhere.

The fix is to define a new propety `swan_home` which always
resolves to the user home.
@tomasr8 tomasr8 requested a review from rodrigo-sobral June 12, 2026 09:28
This is necessary to open files from other users (for sharing tab)
"""
if self.root_dir.startswith("/eos/"):
if self.swan_home.startswith("/eos/"):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes file downloads in JupyterLab

@rodrigo-sobral rodrigo-sobral merged commit 9da3641 into swan-cern:master Jun 12, 2026
4 checks passed
@tomasr8 tomasr8 deleted the fix-root-dir branch June 12, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants