[Bps-public-commit] r16295 - sd/trunk/lib/App/SD

ruz at bestpractical.com ruz at bestpractical.com
Tue Oct 14 23:29:07 EDT 2008


Author: ruz
Date: Tue Oct 14 23:29:06 2008
New Revision: 16295

Modified:
   sd/trunk/lib/App/SD/ForeignReplica.pm

Log:
* sometime we have luids on hands

Modified: sd/trunk/lib/App/SD/ForeignReplica.pm
==============================================================================
--- sd/trunk/lib/App/SD/ForeignReplica.pm	(original)
+++ sd/trunk/lib/App/SD/ForeignReplica.pm	Tue Oct 14 23:29:06 2008
@@ -89,7 +89,7 @@
 # This cache is PERMANENT. - aka not a cache but a mapping table
 
 sub remote_id_for_uuid {
-    my ( $self, $uuid_for_remote_id ) = @_;
+    my ( $self, $uuid_or_luid ) = @_;
 
 
     # XXX: should not access CLI handle
@@ -97,9 +97,10 @@
         handle => Prophet::CLI->new->app_handle->handle,
         type   => 'ticket'
     );
-    $ticket->load( uuid => $uuid_for_remote_id );
-    my $id =  $ticket->prop( $self->uuid . '-id' );
-    return $id;
+    $ticket->load( $uuid_or_luid =~ /^\d+$/? 'luid': 'uuid', $uuid_or_luid );
+    my $prop = $self->uuid . '-id';
+    return scalar $ticket->prop( $prop )
+        or die "ticket #$uuid_or_luid has no property '$prop'";
 }
 
 sub _set_remote_id_for_uuid {



More information about the Bps-public-commit mailing list