From 43d9279061730cb762fedb92114e670cdd8d5e65 Mon Sep 17 00:00:00 2001
From: jbjohnso <jbjohnso@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Date: Wed, 14 May 2008 00:04:55 +0000
Subject: [PATCH] -Allow getNodeAttribs and getAttribs to take either a listref
or list of attributes
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1384 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
---
perl-xCAT-2.0/xCAT/Table.pm | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/perl-xCAT-2.0/xCAT/Table.pm b/perl-xCAT-2.0/xCAT/Table.pm
index fd44219db..3fe14c4fd 100644
--- a/perl-xCAT-2.0/xCAT/Table.pm
+++ b/perl-xCAT-2.0/xCAT/Table.pm
@@ -899,7 +899,12 @@ sub getNodeAttribs
{
my $self = shift;
my $node = shift;
- my @attribs = @{shift()};
+ my @attribs;
+ if (ref $_[0]) {
+ @attribs = @{shift()};
+ } else {
+ @attribs = @_;
+ }
my $datum;
my @data = $self->getNodeAttribs_nosub($node, \@attribs);
#my ($datum, $extra) = $self->getNodeAttribs_nosub($node, \@attribs);
@@ -1462,7 +1467,12 @@ sub getAttribs
#my $key = shift;
#my $keyval = shift;
my %keypairs = %{shift()};
- my @attribs = @_;
+ my @attribs;
+ if (ref $_[0]) {
+ @attribs = @{shift()};
+ } else {
+ @attribs = @_;
+ }
my @return;
my $statement = 'SELECT * FROM ' . $self->{tabname} . ' WHERE ';
my @exeargs;