From ba92de3034517f7196ba410c23cd38fa71de5241 Mon Sep 17 00:00:00 2001 From: phamt Date: Tue, 2 Jul 2013 20:34:09 +0000 Subject: [PATCH] Added option under rinv to collect z/VM user profile names. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16861 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/zvm.pm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index 2b21e1fbc..3b7d15f5c 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -7940,6 +7940,28 @@ sub inventoryHypervisor { xCAT::zvmUtils->printSyslog("smcli System_Disk_Accessibility -T $hcpUserId -k $devNo"); } + # userprofilenames + elsif ( $args->[0] eq "--userprofilenames" ) { + my $argsSize = @{$args}; + if ($argsSize != 1) { + xCAT::zvmUtils->printLn( $callback, "$node: (Error) Wrong number of parameters" ); + return; + } + + # Use Directory_Manager_Search_DM to find user profiles + my $tmp = `ssh $::SUDOER\@$hcp "$::SUDO $::DIR/smcli Directory_Manager_Search_DM -T $hcpUserId -s PROFILE"`; + my @profiles = split('\n', $tmp); + foreach (@profiles) { + # Extract user profile + if ($_) { + $_ =~ /([a-zA-Z]*):*/; + $str .= "$1\n"; + } + } + + xCAT::zvmUtils->printSyslog("smcli Directory_Manager_Search_DM -T $hcpUserId -s PROFILE"); + } + # vlanstats [vlan_id] [user_id] [device] [version] elsif ( $args->[0] eq "--vlanstats" ) { # This is not completed!