[2667] in Moira

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

FW: patch to incremental (fixing the container associated list)

daemon@ATHENA.MIT.EDU (Paul B. Hill)
Mon May 23 17:49:52 2005

Message-Id: <200505232149.j4NLnglV028655@outgoing.mit.edu>
From: "Paul B. Hill" <pbh@MIT.EDU>
To: <moiradev@mit.edu>
Date: Mon, 23 May 2005 17:49:00 -0400
MIME-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Just so that others have the background information...

-----Original Message-----
From: Garry Zacheiss [mailto:zacheiss@MIT.EDU] 
Sent: Wednesday, May 18, 2005 5:03 PM
To: Qing Dong
Cc: zacheiss@MIT.EDU; redelson@MIT.EDU; sdit-win@MIT.EDU
Subject: Re: patch to incremental (fixing the container associated list)

Ok, I've put this change onto ttsp.

Garry

-----Original Message-----
From: Qing Dong [mailto:dongq@MIT.EDU] 
Sent: Wednesday, May 18, 2005 3:18 PM
To: zacheiss@mit.edu
Cc: redelson@mit.edu; sdit-win@mit.edu
Subject: patch to incremental (fixing the container associated list)

Hi, Garry. When a new container is added, the incremental
generates an associated list in moira automatically and links
the list to the new container. The list name is cnt-[container name].
If the list name already exists, we append -[0-9 a-z], which allows for 36 
duplicates. However, NIST reported that the associated lists were not
generated properly for their new containers. It is because they create
a subcontainer "workstations" in most of the containers and when
the associated list name reaches "cnt-workstations-z", it stops generating
lists.


I will change the incremental code. If the container is three levels or
more deep(eg: Machines/EECS/workstations), we will generate the list name 
using the immediate parent name plus the container name. So the associated 
list will be cnt-eecs-workstations instead of cnt-workstations.
Can you put this new code on ttsp so we can run some tests?

Thanks.

Qing


Index: winad.c
===================================================================
RCS file: 
\\afs\all\athena.mit.edu\astaff\project\moiradev\repository/moira/incrementa
l/winad/winad.c,v
retrieving revision 1.44
diff -c -r1.44 winad.c
*** winad.c	2004/09/21 06:08:17	1.44
--- winad.c	2005/05/18 19:10:54
***************
*** 5339,5344 ****
--- 5339,5345 ----
     char temp[64];
     char newGroupName[64];
     char tempGroupName[64];
+   char tempgname[64];
     char *argv[1];
     int  i;
     long rc;
***************
*** 5347,5360 ****

     ptr1 = strrchr(temp, '/');
     if (ptr1 != NULL)
       ptr = ++ptr1;
     else
!     ptr = temp;

!   if (strlen(ptr) > 25)
!     ptr[25] ='\0';

!   sprintf(newGroupName, "cnt-%s", ptr);

     /* change everything to lower case */
     ptr = newGroupName;
--- 5348,5371 ----

     ptr1 = strrchr(temp, '/');
     if (ptr1 != NULL)
+   {
+     *ptr1 = '\0';
       ptr = ++ptr1;
+     ptr1 = strrchr(temp, '/');
+     if (ptr1 != NULL)
+     {
+         sprintf(tempgname, "%s-%s", ++ptr1, ptr);
+     }
+     else
+         strcpy(tempgname, ptr);
+   }
     else
!     strcpy(tempgname, temp);

!   if (strlen(tempgname) > 25)
!     tempgname[25] ='\0';

!   sprintf(newGroupName, "cnt-%s", tempgname);

     /* change everything to lower case */
     ptr = newGroupName;



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