refs #2540. Fixed bug when delete client
parent
177b95f1b6
commit
82d5edb55b
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -1,4 +1,14 @@
|
|||
# Changelog
|
||||
## [0.17.1] - 2025-07-29
|
||||
### Fixed
|
||||
- Se ha corregido un bug que aparecia al borrar un cliente. Este error hacia que se borrara el cliente de la base de datos, pero no del DHCP ( en caso de que perteneciera a uno) y el fichero de arranque.
|
||||
|
||||
---
|
||||
## [0.17.0] - 2025-07-20
|
||||
### Added
|
||||
- Se ha añadido la funcionalidad para modificar imagenes de ogGit.
|
||||
|
||||
---
|
||||
## [0.16.0] - 2025-06-27
|
||||
### Added
|
||||
- Se ha cambiado el html del menu para ser compatible con HTML5.
|
||||
|
|
|
@ -29,7 +29,7 @@ class DeleteHostAction extends AbstractOgDhcpController
|
|||
{
|
||||
$client = $this->entityManager->getRepository(Client::class)->findOneBy(['uuid' => $clientUuid]);
|
||||
|
||||
if (!$client || $client->getSubnet() !== $data) {
|
||||
if (!$client) {
|
||||
throw new BadRequestHttpException('Client not found');
|
||||
}
|
||||
|
||||
|
|
|
@ -103,16 +103,16 @@ readonly class ClientProcessor implements ProcessorInterface
|
|||
private function processDelete($data, Operation $operation, array $uriVariables = [], array $context = []): null
|
||||
{
|
||||
$client = $this->clientRepository->findOneByUuid($uriVariables['uuid']);
|
||||
$this->clientRepository->delete($client);
|
||||
|
||||
if ($this->kernel->getEnvironment() !== 'test') {
|
||||
|
||||
if ($client->getSubnet()) {
|
||||
$this->deleteHostAction->__invoke($client->getSubnet(), $client->getUuid());
|
||||
}
|
||||
$this->deletePxeAction->__invoke($client->getUuid());
|
||||
$this->deletePxeAction->__invoke($client->getMac());
|
||||
}
|
||||
|
||||
$this->clientRepository->delete($client);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue