From dea5659709b5cd4912de6885c20b0e542621ac6a Mon Sep 17 00:00:00 2001 From: phamt Date: Tue, 25 Oct 2011 14:56:53 +0000 Subject: [PATCH] Added command to get default user entry. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10885 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/xcat/plugins/web.pm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/xCAT-UI/xcat/plugins/web.pm b/xCAT-UI/xcat/plugins/web.pm index b45f878f4..27e41c0dc 100644 --- a/xCAT-UI/xcat/plugins/web.pm +++ b/xCAT-UI/xcat/plugins/web.pm @@ -58,7 +58,8 @@ sub process_request { 'gangliacurrent' => \&web_gangliaLatest, 'rinstall' => \&web_rinstall, 'addnode' => \&web_addnode, - 'graph' => \&web_graphinfo + 'graph' => \&web_graphinfo, + 'getdefaultuserentry' => \&web_getdefaultuserentry ); #check whether the request is authorized or not @@ -2167,4 +2168,20 @@ sub web_graphinfo{ $callback->({data => $retstr}); } + +sub web_getdefaultuserentry { + # Get default user entry + my ( $request, $callback, $sub_req ) = @_; + + # Get hardware control point + my $hcp = $request->{arg}->[1]; + my $group = $request->{arg}->[2]; + + if (!$group) { + $group = 'default'; + } + + my $entry = `ssh $hcp "cat /opt/zhcp/conf/$group.direct"`; + $callback->( { data => $entry } ); +} 1;