diff options
author | Russ Allbery <rra@stanford.edu> | 2007-09-26 18:55:03 +0000 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2007-09-26 18:55:03 +0000 |
commit | 7ec47028dbfe6df70d4c07e9546ae1680cf4e91f (patch) | |
tree | a962f796c0ee3b1393d8a6af882d83f498c3a528 /perl/Wallet/Object/Keytab.pm | |
parent | 50d3cd92ea42f76d5a76ec43d869dd8d721ff5f4 (diff) |
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().
Diffstat (limited to 'perl/Wallet/Object/Keytab.pm')
-rw-r--r-- | perl/Wallet/Object/Keytab.pm | 13 |
1 files changed, 13 insertions, 0 deletions
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 |