Merge pull request #781 from inoshperera/master

fixing the agent unable to enroll issue
This commit is contained in:
Madawa Soysa 2017-06-16 15:29:22 +05:30 committed by GitHub
commit 98e8dfea68

View File

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