]> andersk Git - moira.git/commitdiff
If get_host returns MR_NO_MATCH, check host aliases. Fixes the common
authorzacheiss <zacheiss>
Mon, 21 Sep 2009 16:08:19 +0000 (16:08 +0000)
committerzacheiss <zacheiss>
Mon, 21 Sep 2009 16:08:19 +0000 (16:08 +0000)
case where someone is trying to look up an alias for a deleted host.

clients/stella/stella.c

index 8245c2c231bd0c879bd251aafd7347dc7e2fd0cd..7011e4300f23e54ff98e104ac198e76544e6c084 100644 (file)
@@ -686,10 +686,21 @@ int main(int argc, char **argv)
     args[0] = canonicalize_hostname(strdup(hostname));
     args[1] = args[2] = args[3] = "*";
     status = wrap_mr_query("get_host", 4, args, store_host_info, argv);
+
+    /* We might be looking for an alias of a deleted host. */
+    if (status && status == MR_NO_MATCH) {
+      status = wrap_mr_query("get_hostalias", 2, args, store_host_info, argv);
+      if (!status) {
+       args[0] = strdup(argv[1]);
+       status = wrap_mr_query("get_host", 4, args, store_host_info, argv);
+      }
+    }
+
     if (status) {
       com_err(whoami, status, "while getting host information");
       exit(1);
     }
+
     if (unformatted_flag)
       show_host_info_unformatted(argv);
     else
This page took 0.042668 seconds and 5 git commands to generate.