[Bps-public-commit] SD branch, master, updated. 0.74-97-g1210a16

Christine Spang spang at bestpractical.com
Thu Mar 3 01:13:51 EST 2011


The branch, master has been updated
       via  1210a16e30f188e06f6c74447b9dbde4074da7c5 (commit)
      from  a0ee3de1cb6cbe63028d71f8b4c6642006175034 (commit)

Summary of changes:
 lib/App/SD/ForeignReplica.pm |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 1210a16e30f188e06f6c74447b9dbde4074da7c5
Author: Christine Spang <christine at debian.org>
Date:   Thu Mar 3 00:45:12 2011 -0500

    make sure to call set_db_defaults on foreign replica clone
    
    I don't super like this fix, but it's a simpler solution than any other
    I can think of right now.

diff --git a/lib/App/SD/ForeignReplica.pm b/lib/App/SD/ForeignReplica.pm
index 78c34b3..daa9a2e 100644
--- a/lib/App/SD/ForeignReplica.pm
+++ b/lib/App/SD/ForeignReplica.pm
@@ -27,7 +27,10 @@ so the user doesn't have to enter it every time.
 sub save_username_and_token {
     my ($self, $username, $password) = @_;
 
-    # make sure replica is initialized
+    # make sure replica is initialized, since this method is generally called
+    # in the BUILD method of an object, which makes it end up being called
+    # before the initialize call in clone
+    $self->app_handle->handle->after_initialize( sub { shift->app_handle->set_db_defaults } );
     $self->app_handle->handle->initialize;
 
     my $replica_username_key = 'replica.' . $self->scheme . ":" . $self->{url} . '.username';

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list