package chou.cloud.datacenter.utils;

import java.util.ArrayList;
import java.util.List;

import chou.cloud.datacenter.instance.entity.Instance;

public class CommandBuilder {

	private static String createVmCommand = "/usr/local/bin/createvm.py %s %d %d ";

	private static String startVmCommand = "/usr/local/bin/startvm.py %s ";

	private static String stopVmCommand = "/usr/local/bin/stopvm.py %s ";

	public static List<String> buildCreateVmCommands(Instance instance) {
		List<String> commands = new ArrayList<String>();
		String command = String.format(createVmCommand, instance.getName(), instance.getCpuSize(),
				instance.getMemorySize());
		commands.add(command);
		return commands;
	}

	public static List<String> buildStartVmCommands(Instance instance) {
		List<String> commands = new ArrayList<String>();
		String command = String.format(startVmCommand, instance.getName());
		commands.add(command);
		return commands;
	}

	public static List<String> buildStopVmCommands(Instance instance) {
		List<String> commands = new ArrayList<String>();
		String command = String.format(stopVmCommand, instance.getName());
		commands.add(command);
		return commands;
	}

}

@@ -204,32 +204,39 @@
 ateVmCommand = %22
+python 
 /usr/local/bin/c
@@ -292,32 +292,39 @@
 artVmCommand = %22
+python 
 /usr/local/bin/s
@@ -380,16 +380,23 @@
 mand = %22
+python 
 /usr/loc

Add python to command