mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-11-17 09:14:52 +02:00
Do not automatically install appliance after uploading image
This commit is contained in:
parent
01a9e83f08
commit
05d2579907
@ -67,7 +67,7 @@ async def upload_image(
|
|||||||
templates_repo: TemplatesRepository = Depends(get_repository(TemplatesRepository)),
|
templates_repo: TemplatesRepository = Depends(get_repository(TemplatesRepository)),
|
||||||
current_user: schemas.User = Depends(get_current_active_user),
|
current_user: schemas.User = Depends(get_current_active_user),
|
||||||
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)),
|
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)),
|
||||||
install_appliances: Optional[bool] = True
|
install_appliances: Optional[bool] = False
|
||||||
) -> schemas.Image:
|
) -> schemas.Image:
|
||||||
"""
|
"""
|
||||||
Upload an image.
|
Upload an image.
|
||||||
|
@ -181,8 +181,10 @@ class TemplatesService:
|
|||||||
async def _find_image(self, image_path: str):
|
async def _find_image(self, image_path: str):
|
||||||
|
|
||||||
image = await self._templates_repo.get_image(image_path)
|
image = await self._templates_repo.get_image(image_path)
|
||||||
if not image or not os.path.exists(image.path):
|
if not image:
|
||||||
raise ControllerNotFoundError(f"Image '{image_path}' could not be found")
|
raise ControllerNotFoundError(f"Image '{image.filename}' could not be found in the controller database")
|
||||||
|
if not os.path.exists(image.path):
|
||||||
|
raise ControllerNotFoundError(f"Image '{image.path}' could not be found on disk")
|
||||||
return image
|
return image
|
||||||
|
|
||||||
async def _find_images(self, template_type: str, settings: dict) -> List[models.Image]:
|
async def _find_images(self, template_type: str, settings: dict) -> List[models.Image]:
|
||||||
|
Loading…
Reference in New Issue
Block a user