From 133551dd07100c9a3da51743af29629af686596e Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 11 Jan 2013 21:21:05 +0000 Subject: [PATCH] Some fixes for WS PUT operations git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14867 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/xCAT-wsapi/xcatws.cgi | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xCAT-server/xCAT-wsapi/xcatws.cgi b/xCAT-server/xCAT-wsapi/xcatws.cgi index a4de8d5df..502f791bf 100755 --- a/xCAT-server/xCAT-wsapi/xcatws.cgi +++ b/xCAT-server/xCAT-wsapi/xcatws.cgi @@ -1306,6 +1306,7 @@ sub tablesHandler { } elsif (isPut() || isPatch()) { my $condition = $q->param('condition'); + my @vals; if (!defined $condition) { foreach my $put (@{$queryhash{'putData'}}) { my ($key, $value) = split(/=/, $put, 2); @@ -1313,6 +1314,12 @@ sub tablesHandler { $condition = $value; } } + foreach my $put (@{$queryhash{'putData'}}) { + my ($key, $value) = split(/=/, $put, 2); + if ($key eq 'value') { + push(@vals, $value); + } + } } if (!defined $table || !defined $condition) { @@ -1337,8 +1344,13 @@ sub tablesHandler { } else { push @args, $condition; - for ($q->param('value')) { - push @args, "$table.$_"; + if ($q->param('value')) { + for ($q->param('value')) { + push @args, "$table.$_"; + } + } + else { + @args = (@args, @vals); } } }