[Bps-public-commit] r16843 - Prophet/trunk/lib/Prophet/CLI/Command

jesse at bestpractical.com jesse at bestpractical.com
Sat Nov 15 16:10:16 EST 2008


Author: jesse
Date: Sat Nov 15 16:10:16 2008
New Revision: 16843

Modified:
   Prophet/trunk/lib/Prophet/CLI/Command/Merge.pm

Log:
* Deal more gracefully with missing rpelicas when merging.

Modified: Prophet/trunk/lib/Prophet/CLI/Command/Merge.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command/Merge.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/Command/Merge.pm	Sat Nov 15 16:10:16 2008
@@ -16,9 +16,6 @@
     );
 
 
-    if ( ! $target->replica_exists ) {
-        die "The target (".$self->arg('to').") replica doesn't exist"; 
-    }
     
     return  unless $self->validate_merge_replicas($source => $target);
 
@@ -117,6 +114,17 @@
     my $source = shift;
     my $target = shift;
 
+    if ( ! $target->replica_exists ) {
+       $self->handle->log("The target (".$self->arg('to').") replica doesn't exist"); 
+        return 0;
+    }
+
+    if ( ! $source->replica_exists ) {
+       $self->handle->log("The source (".$self->arg('from').") replica doesn't exist"); 
+        return 0;
+    }
+
+
     if ( $target->uuid eq $source->uuid ) {
         $self->handle->log( "You appear to be trying to merge two identical replicas. Skipping.");
         return 0;



More information about the Bps-public-commit mailing list