refs #2506 -- Add error handling for the case where the disk can't be found
parent
012b7a5dbb
commit
cf17d765a0
|
@ -42,6 +42,9 @@ def create_image(disk_num, partition_num, repo, image_name):
|
|||
og_git.progress_callback = OgProgressPrinterWeb()
|
||||
|
||||
device = DiskLib.ogDiskToDev(disk_num, partition_num)
|
||||
if device is None:
|
||||
sys.exit(SystemLib.ogRaiseError([], ogGlobals.OG_ERR_FORMAT, f"Failed to translate disk {disk_num} partition {partition_num} to a device"))
|
||||
|
||||
if og_git.initRepo(device, image_name):
|
||||
return 0
|
||||
else:
|
||||
|
|
|
@ -74,6 +74,8 @@ def commit_image(disk_num, partition_num, repository, branch, options, msg):
|
|||
og_git.progress_callback = OgProgressPrinterWeb()
|
||||
|
||||
device = DiskLib.ogDiskToDev(disk_num, partition_num)
|
||||
if device is None:
|
||||
sys.exit(SystemLib.ogRaiseError([], ogGlobals.OG_ERR_FORMAT, f"Failed to translate disk {disk_num} partition {partition_num} to a device"))
|
||||
|
||||
force_push = False
|
||||
opts = options.split(",")
|
||||
|
|
|
@ -91,6 +91,8 @@ if __name__ == "__main__":
|
|||
og_git.progress_callback = OgProgressPrinterWeb()
|
||||
|
||||
device = DiskLib.ogDiskToDev(args.disk, args.partition)
|
||||
if device is None:
|
||||
sys.exit(SystemLib.ogRaiseError([], ogGlobals.OG_ERR_FORMAT, f"Failed to translate disk {args.disk} partition {args.partition} to a device"))
|
||||
|
||||
og_git.cloneRepo(args.image_name, destination = device, boot_device = device, ref = args.commit, branch = args.branch)
|
||||
|
||||
|
|
Loading…
Reference in New Issue