]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw-admin: use default realm on realm get
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 3 Sep 2015 20:21:17 +0000 (13:21 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Fri, 12 Feb 2016 00:12:40 +0000 (16:12 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_admin.cc

index f10a86002dee2dde86d88fbac988ee0e1231f5d2..7b613a81ff6662f39bbcc3c6b0757322a85667d9 100644 (file)
@@ -1847,13 +1847,19 @@ int main(int argc, char **argv)
     case OPT_REALM_GET:
       {
        RGWRealm realm(realm_id, realm_name);
-       if (realm_name.empty() && realm_id.empty()) {
+#if 0
+       if (
          cerr << "missing realm name or id" << std::endl;
          return -EINVAL;
        }
+#endif
        int ret = realm.init(g_ceph_context, store);
        if (ret < 0) {
-         cerr << "realm.init failed: " << cpp_strerror(-ret) << std::endl;
+         if (ret == -ENOENT && realm_name.empty() && realm_id.empty()) {
+           cerr << "missing realm name or id, or default realm not found" << std::endl;
+         } else {
+           cerr << "realm.init failed: " << cpp_strerror(-ret) << std::endl;
+          }
          return -ret;
        }
        encode_json("realm", realm, formatter);