diff options
author | John Estabrook <jestabro@vyos.io> | 2023-10-31 15:48:12 -0500 |
---|---|---|
committer | John Estabrook <jestabro@vyos.io> | 2023-11-16 12:19:15 -0600 |
commit | fc5dc00a3892fa26d03213854ea5091d6b0c2c18 (patch) | |
tree | e1258ba28281067ea665d9cfd58e7277fb0a493b /src/op_mode | |
parent | 9ffa3e82d951756696367578dd5e82ef0f690065 (diff) | |
download | vyos-1x-fc5dc00a3892fa26d03213854ea5091d6b0c2c18.tar.gz vyos-1x-fc5dc00a3892fa26d03213854ea5091d6b0c2c18.zip |
image: T4516: variable name spelling
Diffstat (limited to 'src/op_mode')
-rwxr-xr-x | src/op_mode/image_manager.py | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/op_mode/image_manager.py b/src/op_mode/image_manager.py index de53c4cf0..e4b2f4833 100755 --- a/src/op_mode/image_manager.py +++ b/src/op_mode/image_manager.py @@ -56,8 +56,8 @@ def delete_image(image_name: Optional[str] = None, exit(MSG_DELETE_IMAGE_DEFAULT) if image_name not in available_images: exit(f'The image "{image_name}" cannot be found') - presistence_storage: str = disk.find_persistence() - if not presistence_storage: + persistence_storage: str = disk.find_persistence() + if not persistence_storage: exit('Persistence storage cannot be found') if not ask_yes_no(f'Do you really want to delete the image {image_name}?', @@ -65,10 +65,10 @@ def delete_image(image_name: Optional[str] = None, exit() # remove files and menu entry - version_path: Path = Path(f'{presistence_storage}/boot/{image_name}') + version_path: Path = Path(f'{persistence_storage}/boot/{image_name}') try: rmtree(version_path) - grub.version_del(image_name, presistence_storage) + grub.version_del(image_name, persistence_storage) print(f'The image "{image_name}" was successfully deleted') except Exception as err: exit(f'Unable to remove the image "{image_name}": {err}') @@ -94,13 +94,13 @@ def set_image(image_name: Optional[str] = None, exit(f'The image "{image_name}" already configured as default') if image_name not in available_images: exit(f'The image "{image_name}" cannot be found') - presistence_storage: str = disk.find_persistence() - if not presistence_storage: + persistence_storage: str = disk.find_persistence() + if not persistence_storage: exit('Persistence storage cannot be found') # set default boot image try: - grub.set_default(image_name, presistence_storage) + grub.set_default(image_name, persistence_storage) print(f'The image "{image_name}" is now default boot image') except Exception as err: exit(f'Unable to set default image "{image_name}": {err}') @@ -124,8 +124,8 @@ def rename_image(name_old: str, name_new: str) -> None: if not image.validate_name(name_new): exit(f'The image name "{name_new}" is not allowed') - presistence_storage: str = disk.find_persistence() - if not presistence_storage: + persistence_storage: str = disk.find_persistence() + if not persistence_storage: exit('Persistence storage cannot be found') if not ask_yes_no( @@ -137,16 +137,16 @@ def rename_image(name_old: str, name_new: str) -> None: try: # replace default boot item if name_old == image.get_default_image(): - grub.set_default(name_new, presistence_storage) + grub.set_default(name_new, persistence_storage) # rename files and dirs - old_path: Path = Path(f'{presistence_storage}/boot/{name_old}') - new_path: Path = Path(f'{presistence_storage}/boot/{name_new}') + old_path: Path = Path(f'{persistence_storage}/boot/{name_old}') + new_path: Path = Path(f'{persistence_storage}/boot/{name_new}') old_path.rename(new_path) # replace boot item - grub.version_del(name_old, presistence_storage) - grub.version_add(name_new, presistence_storage) + grub.version_del(name_old, persistence_storage) + grub.version_add(name_new, persistence_storage) print(f'The image "{name_old}" was renamed to "{name_new}"') except Exception as err: |