fixing the agent unable to enroll issue

revert-70aa11f8
inoshperera 8 years ago
parent 0551598988
commit 58b2bf8b3c

@ -335,7 +335,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
} }
return false; return false;
} }
try {
int tenantId = this.getTenantId(); int tenantId = this.getTenantId();
Device device = this.getDevice(deviceId, false); Device device = this.getDevice(deviceId, false);
@ -350,8 +350,10 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Device has already disenrolled : " + deviceId.getId() + "'"); log.debug("Device has already disenrolled : " + deviceId.getId() + "'");
} }
return false; return true;
} }
try {
device.getEnrolmentInfo().setDateOfLastUpdate(new Date().getTime()); device.getEnrolmentInfo().setDateOfLastUpdate(new Date().getTime());
device.getEnrolmentInfo().setStatus(EnrolmentInfo.Status.REMOVED); device.getEnrolmentInfo().setStatus(EnrolmentInfo.Status.REMOVED);
DeviceManagementDAOFactory.beginTransaction(); DeviceManagementDAOFactory.beginTransaction();

Loading…
Cancel
Save