mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-22 04:31:13 +01:00
Optimized variable naming
This commit is contained in:
parent
9f50c9e5b9
commit
f3ce00dca7
@ -59,15 +59,15 @@ def has_container_with_database(containers):
|
||||
if __name__ == "__main__":
|
||||
# Argument parser setup
|
||||
parser = argparse.ArgumentParser(description='Migrate Docker volumes to SSD or HDD based on container image.')
|
||||
parser.add_argument('--ssd_path', type=str, required=True, help='Path to the SSD storage')
|
||||
parser.add_argument('--hdd_path', type=str, required=True, help='Path to the HDD storage')
|
||||
parser.add_argument('--rapid-storage-path', type=str, required=True, help='Path to the SSD storage')
|
||||
parser.add_argument('--mass-storage-path', type=str, required=True, help='Path to the HDD storage')
|
||||
|
||||
# Parse arguments
|
||||
args = parser.parse_args()
|
||||
|
||||
# Set paths from arguments
|
||||
ssd_path = args.ssd_path
|
||||
hdd_path = args.hdd_path
|
||||
rapid_storage_path = args.rapid_storage_path
|
||||
mass_storage_path = args.mass_storage_path
|
||||
|
||||
# List all Docker volumes
|
||||
volumes = run_command("docker volume ls -q").splitlines()
|
||||
@ -79,10 +79,10 @@ if __name__ == "__main__":
|
||||
print(f"Skipped Volume {volume}. The storage path {volume_path} is a symbolic link.")
|
||||
elif has_container_with_database(containers):
|
||||
print(f"Safing volume {volume} on SSD.")
|
||||
pause_and_move(ssd_path, volume, volume_path, containers)
|
||||
pause_and_move(rapid_storage_path, volume, volume_path, containers)
|
||||
else:
|
||||
print(f"Safing volume {volume} on HDD.")
|
||||
pause_and_move(hdd_path, volume, volume_path, containers)
|
||||
pause_and_move(mass_storage_path, volume, volume_path, containers)
|
||||
|
||||
print("Operation completed.")
|
||||
|
Loading…
Reference in New Issue
Block a user