Skip to content

Commit

Permalink
Merge pull request #611 from Ana06/vbox-export-snapshots
Browse files Browse the repository at this point in the history
[vbox-export-snapshots] Minor improvement: Add EXPORTED_VM_NAME
  • Loading branch information
Ana06 authored Sep 2, 2024
2 parents 50adc99 + affaf91 commit b17c320
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions virtualbox/vbox-export-snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
from virtualbox.library import NetworkAttachmentType as NetType
from datetime import datetime

# Base name of the exported VMs
EXPORTED_VM_NAME = "FLARE-VM"
# Name of the VM to export the snapshots from
VM_NAME = "FLARE-VM.testing"
VM_NAME = f"{EXPORTED_VM_NAME}.testing"

# Name of the directory in HOME to export the VMs
# The directory is created if it does not exist
Expand Down Expand Up @@ -63,7 +65,7 @@ def change_network_adapters(vm, max_adapters):
print(f"Restored '{snapshot_name}' and changed its adapter(s) to host-only")

# Export .ova
exported_vm_name = f"FLARE-VM.{date}{extension}"
exported_vm_name = f"{EXPORTED_VM_NAME}.{date}{extension}"
export_directory = os.path.expanduser(f"~/{EXPORT_DIR_NAME}")
os.makedirs(export_directory, exist_ok=True)
filename = os.path.join(export_directory, f"{exported_vm_name}.ova")
Expand Down

0 comments on commit b17c320

Please sign in to comment.