Improve the logic in auto-installation; Add auto-remove on the failed files
This commit is contained in:
@@ -12,7 +12,7 @@ import psutil
|
|||||||
import requests
|
import requests
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
__version__ = "0.1.8"
|
__version__ = "0.1.9"
|
||||||
|
|
||||||
MAX_RETRY_TIMES = 10
|
MAX_RETRY_TIMES = 10
|
||||||
UBUNTU_ARM_URL = "https://huggingface.co/datasets/xlangai/ubuntu_arm/resolve/main/Ubuntu.zip"
|
UBUNTU_ARM_URL = "https://huggingface.co/datasets/xlangai/ubuntu_arm/resolve/main/Ubuntu.zip"
|
||||||
@@ -95,6 +95,7 @@ class VirtualMachineManager:
|
|||||||
file.writelines(new_lines)
|
file.writelines(new_lines)
|
||||||
|
|
||||||
# Check and clean on the files inside vms_dir, delete the unregistered ones
|
# Check and clean on the files inside vms_dir, delete the unregistered ones
|
||||||
|
os.makedirs(vms_dir, exist_ok=True)
|
||||||
vm_names = os.listdir(vms_dir)
|
vm_names = os.listdir(vms_dir)
|
||||||
for vm_name in vm_names:
|
for vm_name in vm_names:
|
||||||
# skip the downloaded .zip file
|
# skip the downloaded .zip file
|
||||||
|
|||||||
Reference in New Issue
Block a user