diff --git a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java index 16a3be8..456f22e 100644 --- a/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/pac/PacProcessorFactory.java @@ -44,7 +44,7 @@ public class PacProcessorFactory implements EntityProcessorFactory { UnixUser unixUser = getPacAdminUser(pac); String password = PwGenerator.generatePassword(7, flagBuilder.build(), 100, random); Map hiveValues = fillHiveValues(hive); - List> pacValuesList = fillPacValuesList(hive); + List> pacValuesList = fillPacValuesList(hive, null); Map emailVars = fillEMailValues(pacName, customerEMail, password); Processor priProcessor = new CompoundProcessor( createAddUserProc(pacName, unixUser, password), @@ -70,7 +70,7 @@ public class PacProcessorFactory implements EntityProcessorFactory { Pac pac = (Pac) entity; Hive hive = pac.getHive(); Map hiveValues = fillHiveValues(hive); - List> pacValuesList = fillPacValuesList(hive); + List> pacValuesList = fillPacValuesList(hive, pac); WaitingTasksProcessor waitingProcessor = new WaitingTasksProcessor(new CompoundProcessor( createEtcHostsProc(hiveValues, pacValuesList), createNetworkInterfacesProc(hiveValues, pacValuesList), @@ -163,14 +163,16 @@ public class PacProcessorFactory implements EntityProcessorFactory { return hiveValues; } - private List> fillPacValuesList(Hive hive) { + private List> fillPacValuesList(Hive hive, Pac pac) { List> pacValuesList = new ArrayList>(); Set pacsSet = hive.getPacs(); for (Pac p : pacsSet) { HashMap pacValues = new HashMap(); pacValues.put("PAC", p.getName()); pacValues.put("PAC_IP", p.getCurINetAddr().getInetAddr()); - pacValuesList.add(pacValues); + if (pac == null || pac.getId() != p.getId()) { + pacValuesList.add(pacValues); + } } return pacValuesList; }