From f003a5cc697ea01b38883c4a0c5487af48a80fe1 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Thu, 28 Jul 2011 19:00:36 +0200
Subject: [PATCH] delete pac users

---
 hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java |    8 +++++---
 hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java       |    1 -
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java b/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java
index 911366d..8b1ec24 100644
--- a/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java
+++ b/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java
@@ -148,7 +148,6 @@
 		for (UnixUser user : pac.getUnixUser()) {
 			if (!pacName.equals(user.getName())) {
 				helperModule.delete(user);
-//				pac.getUnixUser().remove(user);
 			}
 		}
 		super.delete(existingEntity);
diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
index 1423b48..f96a02a 100644
--- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
+++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java
@@ -68,16 +68,18 @@
 	public <T extends AbstractEntity> Processor createDeleteProcessor(
 			EntityManager em, T entity) throws ProcessorException {
 		Pac pac = (Pac) entity;
+		em.refresh(pac);
 		Hive hive = pac.getHive();
 		UnixUser unixUser = getPacAdminUser(pac);
 		Map<String, String> hiveValues = fillHiveValues(hive);
 		List<Map<String, String>> pacValuesList = fillPacValuesList(hive);
-		return new CompoundProcessor(
+		WaitingTasksProcessor waitingProcessor = new WaitingTasksProcessor(new CompoundProcessor(
 				createEtcHostsProc(hiveValues, pacValuesList), 
 				createNetworkInterfacesProc(hiveValues, pacValuesList), 
 				createSudouersProc(hiveValues, pacValuesList), 
-				createProftpdConfProc(hiveValues, pacValuesList), 
-				createDelUserProc(unixUser.getName()));
+				createProftpdConfProc(hiveValues, pacValuesList)));
+		waitingProcessor.appendProcessor(pac.getHiveName(), createDelUserProc(unixUser.getName()), "remove packet");
+		return waitingProcessor;
 	}
 
 	private TemplateProcessor createEtcHostsProc(

--
Gitblit v1.9.1