]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: check for monmap_file _first_
authorSage Weil <sage@newdream.net>
Wed, 11 Mar 2009 18:35:08 +0000 (11:35 -0700)
committerSage Weil <sage@newdream.net>
Wed, 11 Mar 2009 18:35:08 +0000 (11:35 -0700)
src/mon/MonClient.cc

index 494c5b10d60811917786db90a9c403fea2d37ebd..8a1bf9ac5bf34c13c72c3a8cb0efe20fe1957d05 100644 (file)
@@ -83,6 +83,18 @@ int MonClient::get_monmap(MonMap *pmonmap)
 {
   static string monstr;
 
+  if (g_conf.monmap_file) {
+    // file?
+    const char *monmap_fn = g_conf.monmap_file;
+    int r = pmonmap->read(monmap_fn);
+    if (r >= 0) {
+      cout << "[opened monmap at " << monmap_fn << " fsid " << pmonmap->fsid << "]" << std::endl;
+      return 0;
+    }
+
+    cerr << "unable to read monmap from " << monmap_fn << ": " << strerror(errno) << std::endl;
+  }
+
   if (!g_conf.mon_host) {
     // cluster conf?
     ConfFile a(g_conf.cluster_conf);
@@ -115,18 +127,6 @@ int MonClient::get_monmap(MonMap *pmonmap)
       probe_mon(pmonmap) == 0)  
     return 0;
 
-  if (g_conf.monmap_file) {
-    // file?
-    const char *monmap_fn = g_conf.monmap_file;
-    int r = pmonmap->read(monmap_fn);
-    if (r >= 0) {
-      cout << "[opened monmap at " << monmap_fn << " fsid " << pmonmap->fsid << "]" << std::endl;
-      return 0;
-    }
-
-    cerr << "unable to read monmap from " << monmap_fn << ": " << strerror(errno) << std::endl;
-  }
-
   cerr << "must specify monitor address (-m monaddr) or cluster conf (-C cluster.conf) or monmap file (-M monmap)" << std::endl;
   return -1;
 }