mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 03:46:55 +00:00
Cleanup with ruff check (#1182)
* Implement improvements suggested by ruff check. * Add ruff check to CI.
This commit is contained in:
@@ -890,14 +890,15 @@ def _preprocess_mounts(
|
||||
check_collision(container, "volumes")
|
||||
new_vols.append(f"{host}:{container}:{mode}")
|
||||
continue
|
||||
if len(parts) == 2:
|
||||
if not _is_volume_permissions(parts[1]) and re.match(
|
||||
r"[.~]", parts[0]
|
||||
):
|
||||
host = os.path.abspath(os.path.expanduser(parts[0]))
|
||||
check_collision(parts[1], "volumes")
|
||||
new_vols.append(f"{host}:{parts[1]}:rw")
|
||||
continue
|
||||
if (
|
||||
len(parts) == 2
|
||||
and not _is_volume_permissions(parts[1])
|
||||
and re.match(r"[.~]", parts[0])
|
||||
):
|
||||
host = os.path.abspath(os.path.expanduser(parts[0]))
|
||||
check_collision(parts[1], "volumes")
|
||||
new_vols.append(f"{host}:{parts[1]}:rw")
|
||||
continue
|
||||
check_collision(parts[min(1, len(parts) - 1)], "volumes")
|
||||
new_vols.append(vol)
|
||||
values["volumes"] = new_vols
|
||||
|
||||
Reference in New Issue
Block a user