Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 10, 2023
1 parent 9e43b7e commit 4e79e74
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions dockerspawner/systemuserspawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class SystemUserSpawner(DockerSpawner):
"""
),
)

image_homedir_propagation = Unicode(
"rprivate",
config=True,
Expand Down Expand Up @@ -137,11 +137,18 @@ def homedirpropagation(self):
"""
Setting for the propagation mode for home dir. Wrong values are defaulted to `rprivate`.
"""
if self.image_homedir_propagation in ('rshared','shared','rprivate', 'private', 'rslave', 'slave'):
if self.image_homedir_propagation in (
'rshared',
'shared',
'rprivate',
'private',
'rslave',
'slave',
):
return self.image_homedir_propagation
else:
else:
return 'rprivate'

@property
def volume_binds(self):
"""
Expand All @@ -154,7 +161,11 @@ def volume_binds(self):
}
"""
volumes = super().volume_binds
volumes[self.host_homedir] = {'bind': self.homedir, 'ro': False, 'propagation': self.homedirpropagation}
volumes[self.host_homedir] = {
'bind': self.homedir,
'ro': False,
'propagation': self.homedirpropagation,
}
return volumes

def get_env(self):
Expand Down

0 comments on commit 4e79e74

Please sign in to comment.