DBCreator: Fix ScriptRunner to strip comments, reformat code

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-01-17 16:08:51 -08:00
parent 6d155416c2
commit ef07cde449
2 changed files with 13 additions and 11 deletions

View File

@ -31,17 +31,15 @@ import com.cloud.utils.component.SystemIntegrityChecker;
import com.cloud.utils.db.ScriptRunner;
import com.cloud.utils.db.Transaction;
/**
* Creates the CloudStack Database by using the 4.0 schema and apply
* upgrade steps to it.
*/
// Creates the CloudStack Database by using the 4.0 schema and apply
// upgrade steps to it.
public class DatabaseCreator {
protected static void printHelp(String cmd) {
System.out.println(
"DatabaseCreator creates the database schema by removing the \n" +
"previous schema, creating the schema, and running \n" +
"through the database updaters.");
System.out.println("Usage: " + cmd + " [initial schema file] [database upgrade class]");
System.out.println("Usage: " + cmd + " [schema files] [database upgrade class]");
}
public static void main(String[] args) {

View File

@ -170,6 +170,10 @@ public class ScriptRunner {
}
Thread.yield();
} else {
int idx = line.indexOf("--");
if (idx != -1)
command.append(line.substring(0, idx));
else
command.append(line);
command.append(" ");
}