From 7ec47028dbfe6df70d4c07e9546ae1680cf4e91f Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 26 Sep 2007 18:55:03 +0000 Subject: Include the synchronization configuration in show() output. Provide a new object method that subclasses can override to add attribute information to show() and remove the documentation about overriding show(). --- perl/Wallet/Object/Keytab.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'perl/Wallet/Object/Keytab.pm') diff --git a/perl/Wallet/Object/Keytab.pm b/perl/Wallet/Object/Keytab.pm index 5f128b0..c78adc2 100644 --- a/perl/Wallet/Object/Keytab.pm +++ b/perl/Wallet/Object/Keytab.pm @@ -475,6 +475,19 @@ sub attr { } } +# Override attr_show to display the sync attribute. +sub attr_show { + my ($self) = @_; + my @targets = $self->attr ('sync'); + if (not @targets and $self->error) { + return undef; + } elsif (@targets) { + return sprintf ("%15s: %s\n", 'Synced with', "@targets"); + } else { + return ''; + } +} + # Override create to start by creating the principal in Kerberos and only # create the entry in the database if that succeeds. Error handling isn't # great here since we don't have a way to communicate the error back to the -- cgit v1.2.3