[1928] in Moira Commits

home help back first fref pref prev next nref lref last post

/svn/moira r4067 - trunk/moira/server

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Tue Jan 31 09:19:29 2012

Date: Tue, 31 Jan 2012 09:19:28 -0500
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201201311419.q0VEJSwA017338@drugstore.mit.edu>
To: moira-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: zacheiss
Date: 2012-01-31 09:19:28 -0500 (Tue, 31 Jan 2012)
New Revision: 4067

Modified:
   trunk/moira/server/increment.pc
Log:
Include subnet name in incremental arguments for the machine table.

Modified: trunk/moira/server/increment.pc
===================================================================
--- trunk/moira/server/increment.pc	2012-01-19 21:44:57 UTC (rev 4066)
+++ trunk/moira/server/increment.pc	2012-01-31 14:19:28 UTC (rev 4067)
@@ -105,10 +105,10 @@
     case MACHINE_TABLE:
       sprintf(stmt_buf, "SELECT m.name, m.mach_id, m.vendor, m.model, m.os, m.location, "
 	      "m.contact, m.billing_contact, m.account_number, m.status, m.address,"
-	      "m.owner_type, m.owner_id, m.acomment, m.ocomment FROM machine m "
+	      "m.owner_type, m.owner_id, m.acomment, m.ocomment, m.snet_id FROM machine m "
 	      "WHERE %s", qual);
       dosql(before);
-      beforec = 15;
+      beforec = 16;
       name = xmalloc(0);
       id = atoi(before[12]);
       if (!strncmp(before[11], "USER", 4))
@@ -132,6 +132,9 @@
       id = atoi(before[14]);
       id_to_name(id, STRINGS_TABLE, &name);
       strcpy(before[14], name);
+      id = atoi(before[15]);
+      id_to_name(id, SUBNET_TABLE, &name);
+      strcpy(before[15], name);
       break;
     case HOSTALIAS_TABLE:
       strcpy(before[0], argv[0]);
@@ -324,10 +327,10 @@
     case MACHINE_TABLE:
       sprintf(stmt_buf, "SELECT m.name, m.mach_id, m.vendor, m.model, m.os, m.location, "
               "m.contact, m.billing_contact, m.account_number, m.status, m.address,"
-              "m.owner_type, m.owner_id, m.acomment, m.ocomment FROM machine m "
+              "m.owner_type, m.owner_id, m.acomment, m.ocomment, m.snet_id FROM machine m "
               "WHERE %s", qual);
       dosql(after);
-      afterc = 15;
+      afterc = 16;
       name = xmalloc(0);
       id = atoi(after[12]);
       if (!strncmp(after[11], "USER", 4))
@@ -351,6 +354,9 @@
       id = atoi(after[14]);
       id_to_name(id, STRINGS_TABLE, &name);
       strcpy(after[14], name);
+      id = atoi(after[15]);
+      id_to_name(id, SUBNET_TABLE, &name);
+      strcpy(after[15], name);
       break;
     case HOSTALIAS_TABLE:
       strcpy(after[0], argv[0]);


home help back first fref pref prev next nref lref last post