[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 13/16] mg-schema-test-database: Change username for back-to-main-db xref



The `username' of the xdbref task in the test db, referring to the
main db, is changed to `PARENT' (from `<username>@<nodename>').

Currently this is purely cosmetic, but it is going to be useful to
distinguish the two cases:
 * This is a test DB and contains references to a parent
 * This is a parent DB (probably the main DB) which contains
   references to child test DBS.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
v2: New patch
---
 mg-schema-test-database |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mg-schema-test-database b/mg-schema-test-database
index b1b5e60..78f26db 100755
--- a/mg-schema-test-database
+++ b/mg-schema-test-database
@@ -152,10 +152,11 @@ make_xdbref_task () {
        local refkey=$1; shift
        local comment=$1; shift
        local refinfo=$1; shift
+       local taskusername=$1; shift
        echo "
                INSERT INTO tasks
                        (type, refkey, username, comment, live, refinfo)
-                 VALUES ('xdbref','$refkey','$username@$nodename',
+                 VALUES ('xdbref','$refkey','$taskusername',
                          '$comment','t','$refinfo');
        "
 }
@@ -373,7 +374,8 @@ END
        for task in $tasks; do
                psql_do <<END
                        BEGIN;
-                       $(make_xdbref_task $dbname 'borrowed for test db' $task)
+                       $(make_xdbref_task $dbname 'borrowed for test db' \
+                               $task "$username@$nodename")
                        UPDATE resources SET owntaskid = $(borrowtaskid $task)
                                WHERE owntaskid=$task;
                        COMMIT;
@@ -411,7 +413,7 @@ END
        # As we copy, we note everything we're not borrowing as
        # belonging to the parent db.
        cat >>$t.import <<END
-               $(make_xdbref_task $maindbname 'not borrowed' '')
+               $(make_xdbref_task $maindbname 'not borrowed' '' PARENT)
                UPDATE resources
                        SET owntaskid = $(taskid xdbref $maindbname)
                        WHERE owntaskid != $(borrowtaskid $task);
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.