]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: improved error message when adding a duplicate mirror pool peer
authorJason Dillaman <dillaman@redhat.com>
Wed, 15 Apr 2020 19:21:55 +0000 (15:21 -0400)
committerNathan Cutler <ncutler@suse.com>
Mon, 20 Apr 2020 11:13:58 +0000 (13:13 +0200)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 74cded6b0de90660db46d0dea0cd35ca0bba563e)

src/tools/rbd/action/MirrorPool.cc

index bfdc63627a252040355716dbff662afec1165481..603e0f0f014eca23f962f6c9f2b11f804a80a4d8 100644 (file)
@@ -1042,7 +1042,10 @@ int execute_peer_add(const po::variables_map &vm,
   std::string uuid;
   r = rbd.mirror_peer_site_add(
     io_ctx, &uuid, mirror_peer_direction, remote_cluster, remote_client_name);
-  if (r < 0) {
+  if (r == -EEXIST) {
+    std::cerr << "rbd: mirror peer already exists" << std::endl;
+    return r;
+  } else if (r < 0) {
     std::cerr << "rbd: error adding mirror peer" << std::endl;
     return r;
   }