Created cache directory if there is none, and changed cache directory path.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8315 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -1014,14 +1014,20 @@ sub getUserProfile { | ||||
| 	# Set directory where executables are on zHCP | ||||
| 	my $hcpDir = "/opt/zhcp/bin"; | ||||
|  | ||||
| 	my $out; | ||||
|  | ||||
| 	# Set directory for cache | ||||
| 	my $cache = '/var/opt/zhcp/.vmapi/.cache'; | ||||
| 	my $cache = '/var/opt/zhcp/cache'; | ||||
| 	# If the cache directory does not exist | ||||
| 	if (!(`ssh $hcp "test -d $cache && echo Exists"`)) { | ||||
| 		# Create cache directory | ||||
| 		$out = `ssh $hcp "mkdir -p $cache"`; | ||||
| 	} | ||||
|  | ||||
| 	# Set output file name | ||||
| 	my $file = "$cache/$profile.profile"; | ||||
|  | ||||
| 	# If a cache for the user profile exists | ||||
| 	my $out; | ||||
| 	if (`ssh $hcp "ls $file"`) { | ||||
|  | ||||
| 		# Get current Epoch | ||||
|   | ||||
| @@ -1488,7 +1488,7 @@ sub listVM { | ||||
| 	my ( $callback, $node, $args ) = @_; | ||||
|  | ||||
| 	# Set cache directory | ||||
| 	my $cache = '/var/opt/zhcp/.vmapi/.cache'; | ||||
| 	my $cache = '/var/opt/zhcp/cache'; | ||||
|  | ||||
| 	# Get node properties from 'zvm' table | ||||
| 	my @propNames = ( 'hcp', 'userid' ); | ||||
| @@ -1512,6 +1512,12 @@ sub listVM { | ||||
|  | ||||
| 	# Get disk pool names | ||||
| 	if ( $args->[0] eq "--diskpoolnames" ) { | ||||
| 		# If the cache directory does not exist | ||||
| 		if (!(`ssh $hcp "test -d $cache && echo Exists"`)) { | ||||
| 			# Create cache directory | ||||
| 			$out = `ssh $hcp "mkdir -p $cache"`; | ||||
| 		} | ||||
| 		 | ||||
| 		my $file = "$cache/diskpoolnames"; | ||||
| 		 | ||||
| 		# If a cache for disk pool names exists | ||||
|   | ||||
		Reference in New Issue
	
	Block a user