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:
phamt 2010-12-03 21:28:43 +00:00
parent fab2089270
commit c65badf386
2 changed files with 15 additions and 3 deletions

View File

@ -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

View File

@ -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