]> andersk Git - moira.git/commitdiff
Support setting/displaying publicflg for containers, and displaying
authorzacheiss <zacheiss>
Fri, 2 Aug 2002 10:32:25 +0000 (10:32 +0000)
committerzacheiss <zacheiss>
Fri, 2 Aug 2002 10:32:25 +0000 (10:32 +0000)
associated list for containers.  We don't provide UI for calling the
set_container_list query because it's not something a user should ever
need to do.

clients/moira/cluster.c
clients/moira/defs.h

index b537e505fec410529f60b36b8a6b94d63f7408a1..88aeed65f3c461a79627f175f978ecf8b3e8522c 100644 (file)
@@ -169,6 +169,7 @@ static char **SetClusterDefaults(char **info, char *name)
 static char **SetContainerDefaults(char **info, char *name)
 {
   info[CON_NAME] = strdup(name);
+  info[CON_PUBLIC] = strdup(DEFAULT_NO);
   info[CON_DESCRIPT] = strdup(CON_DEFAULT_TYPE);
   info[CON_LOCATION] = strdup(CON_DEFAULT_TYPE);
   info[CON_CONTACT] = strdup(CON_DEFAULT_TYPE);
@@ -822,6 +823,9 @@ char **AskMCDInfo(char **info, int type, Bool name)
        return NULL;
       break;
     case CONTAINER:
+      if (GetYesNoValueFromUser("Is this a public container", 
+                               &info[CON_PUBLIC]) == SUB_ERROR)
+       return NULL;
       if (GetValueFromUser("Container's Description:", &info[CON_DESCRIPT]) ==
          SUB_ERROR)
        return NULL;
@@ -2117,10 +2121,28 @@ int ShowContainerInfo(int argc, char **argv)
 static char *PrintContainerInfo(char **info)
 {
   char buf[BUFSIZ], tbuf[256];
+  char *args[2];
+  struct mqelem *elem = NULL;
+  int stat;
 
   Put_message("");
-  sprintf(buf, "Container:      %-16s", info[CON_NAME]);
+  sprintf(buf, "Container:      %-16s    Public:      %s", info[CON_NAME],
+         atoi(info[CON_PUBLIC]) ? "Yes" : "No");
   Put_message(buf);
+  /* Do a get_container_list to see what the associated list is. */
+  args[0] = info[CON_NAME];
+  if (stat = do_mr_query("get_container_list", 1, args, StoreInfo, &elem))
+    {
+      if (stat != MR_NO_MATCH)
+       com_err(program_name, stat, " looking up container list");
+    }
+  else 
+    {
+      sprintf(buf, "Container's associated list is: LIST %s",
+             ((char **)elem->q_data)[1]);
+      Put_message(buf);
+      FreeQueue(elem);
+    }
   sprintf(buf, "Description:    %-16s", info[CON_DESCRIPT]);
   Put_message(buf);
   sprintf(buf, "Location:       %-16s    Contact:     %s", info[CON_LOCATION],
@@ -2138,7 +2160,7 @@ static char *PrintContainerInfo(char **info)
   sprintf(buf, MOD_FORMAT, info[CON_MODBY], info[CON_MODTIME], 
          info[CON_MODWITH]);
   Put_message(buf);
-  return info[CON_NAME];
+  return(info[CON_NAME]);
 }
 
 static char *PrintContainer(char **info)
index ca27e1c39a3c2c58a837a391773bbc47b55a0eb9..f1873006d6d30ca923269b53590909818f7b46f9 100644 (file)
@@ -50,7 +50,7 @@ typedef int Bool;
 
 /* What version of the queries are we asking for? */
 
-#define QUERY_VERSION 8
+#define QUERY_VERSION 9
 
 /* This is unimplemented in the menu stuff, but would be nice. */
 
This page took 0.26516 seconds and 5 git commands to generate.