]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
mg-hosts: manual-task-create option
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 17 Oct 2013 14:36:02 +0000 (15:36 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 17 Oct 2013 14:36:02 +0000 (15:36 +0100)
mg-hosts

index f9790a5f456d89e4b71888e5a3ca1c5ebe06f38c..e4092015290e8dc022487986074c1599a47550c5 100755 (executable)
--- a/mg-hosts
+++ b/mg-hosts
@@ -218,6 +218,17 @@ END
     });
 }
 
+sub cmd_manual_task_create () {
+    @ARGV==1 or die "bad usage\n";
+    my $refkey = shift @ARGV;
+    $refkey =~ m/^\w+/ or die "bad task refkey\n";
+    my $q = $dbh_tests->prepare(<<END);
+        INSERT INTO tasks (type,    refkey,username,comment, live,refinfo)
+                   VALUES ('static',?,     ?,       'manual','t', '')
+END
+    db_retry($dbh_tests,[qw(resources)], sub { $q->execute($refkey,$refkey); });
+}
+
 sub cmd_previoustasks () {
     my $doclear = (@ARGV==0 ? 0 :
                   @ARGV==1 && $ARGV[0] eq '--clear' ? 1 :