From: Matt <mat...@us...> - 2007-06-28 12:22:38
|
Update of /cvsroot/openqrm/plugins/linuxcoe/main/code/java/com/qlusters/qrm/plugins/linuxcoe In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1382/plugins/linuxcoe/main/code/java/com/qlusters/qrm/plugins/linuxcoe Modified Files: LinuxCoeProfileManager.java Log Message: :) got the first fully automatic installation working Index: LinuxCoeProfileManager.java =================================================================== RCS file: /cvsroot/openqrm/plugins/linuxcoe/main/code/java/com/qlusters/qrm/plugins/linuxcoe/LinuxCoeProfileManager.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LinuxCoeProfileManager.java 26 Jun 2007 18:20:45 -0000 1.3 --- LinuxCoeProfileManager.java 28 Jun 2007 12:22:22 -0000 1.4 *************** *** 32,36 **** --- 32,43 ---- import java.io.*; import com.qlusters.qrm.server.logic.controller.commands.*; + import com.qlusters.qrm.server.logic.controller.*; + import com.qlusters.qrm.server.logic.resources.ComputeResourcesFinder; + import com.qlusters.qrm.server.api.objects.ComputeResourceData; + import com.qlusters.qrm.server.api.exceptions.resources.ComputeResourceNotFoundException; + import com.qlusters.qrm.server.api.exceptions.resources.ComputeResourceOperationNotPermittedException; import com.qlusters.qrm.utils.Prefs; + import com.qlusters.qrm.utils.NetUtils; + import com.qlusters.qrm.exceptions.InvalidIpException; /** *************** *** 98,102 **** // String id -> resource id to install // String ip -> resource ip to install ! public String install(String profile_number, String install_method, String id, String ip) { String cmd = LinuxCoeCommandScript; cmd=cmd + " install "; --- 105,111 ---- // String id -> resource id to install // String ip -> resource ip to install ! public String install(String profile_number, String install_method, String id, String ip) ! throws ComputeResourceNotFoundException, ComputeResourceOperationNotPermittedException, InvalidIpException { ! String cmd = LinuxCoeCommandScript; cmd=cmd + " install "; *************** *** 115,118 **** --- 124,143 ---- System.out.println("OUT: " + stdout); System.out.println("ERR:" + out.getErrorString()); + + + // reboot + remove the resource + + // get the resourcedata + Integer resource_id = Integer.valueOf(id).intValue(); + ComputeResourceData resource = ComputeResourcesFinder.getInstance().getResourceById(resource_id); + + //Long ipl = NetUtils.stringIpToLong(ip); + //ComputeResourceData resource = ComputeResourcesFinder.getInstance().getResourceByIp(ipl); + + // force delete + ResourceController resc = new ResourceController(); + resc.delete(resource, true); + + return stdout; } |