From 91ff649beae9940194e192123f1cda29d60fb265 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 3 Mar 2014 13:15:06 -0500 Subject: [PATCH] more zone functions --- perl-xCAT/xCAT/Zone.pm | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/perl-xCAT/xCAT/Zone.pm b/perl-xCAT/xCAT/Zone.pm index e712d2dd1..e790cec36 100644 --- a/perl-xCAT/xCAT/Zone.pm +++ b/perl-xCAT/xCAT/Zone.pm @@ -202,6 +202,32 @@ sub iszonedefined } #-------------------------------------------------------------------------------- +=head3 getzonekeydir + Arguments: + zonename + Returns: + path to the root ssh keys for the zone /etc/xcat/sshkeys//.ssh + 1 - zone not defined + Example: + xCAT::Zone->getzonekeydir($zonename); +=cut + +#-------------------------------------------------------------------------------- +sub getzonekeydir +{ + my ($class,$zonename) = @_; + my $tab = xCAT::Table->new("zone"); + $tab->close(); + my $zonehash = $tab->getAttribs({zonename => $zonename},'sshkeydir'); + if ( keys %$zonehash) { + my $zonesshkeydir=$zonehash->{sshkeydir}; + return $zonesshkeydir; + }else{ + return 1; # this is a bad error zone not defined + } +} +#-------------------------------------------------------------------------------- + =head3 getmyzonename Arguments: $node -one nodename