mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-06-18 20:30:56 +00:00
set default value for $::XCATSITEVALS{httpport} if site.httpport is not specified (#5780)
This commit is contained in:
@ -1037,6 +1037,11 @@ sub populate_site_hash {
|
||||
foreach (@records) {
|
||||
$::XCATSITEVALS{ $_->{key} } = $_->{value};
|
||||
}
|
||||
|
||||
unless (exists($::XCATSITEVALS{'httpport'}) and ($::XCATSITEVALS{'httpport'} ne "")){
|
||||
$::XCATSITEVALS{'httpport'}="80";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -146,7 +146,7 @@ sub subvars {
|
||||
}
|
||||
$ENV{HTTPPORT} = $httpport;
|
||||
|
||||
|
||||
my $httpportsuffix=":$httpport";
|
||||
#replace the env with the right value so that correct include files can be found
|
||||
$inc =~ s/#ENV:([^#]+)#/envvar($1)/eg;
|
||||
my $res;
|
||||
@ -303,11 +303,11 @@ sub subvars {
|
||||
if ($c == 0) {
|
||||
# After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x
|
||||
# the rhels5.9 will not be installed successfully. So put in kickstart directly.
|
||||
$source_in_pre .= "echo 'url --url http://'\$nextserver':$httpport/$pkgdir' >> /tmp/repos";
|
||||
$source .= "url --url http://#TABLE:noderes:\$NODE:nfsserver#:#TABLE:site:key=httpport:value#/$pkgdir\n"; #For rhels5.9
|
||||
$source_in_pre .= "echo 'url --url http://'\$nextserver'$httpportsuffix/$pkgdir' >> /tmp/repos";
|
||||
$source .= "url --url http://#TABLE:noderes:\$NODE:nfsserver#$httpportsuffix/$pkgdir\n"; #For rhels5.9
|
||||
} else {
|
||||
$source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=http://'\$nextserver':$httpport/$pkgdir' >> /tmp/repos";
|
||||
$source .= "repo --name=pkg$c --baseurl=http://#TABLE:noderes:\$NODE:nfsserver#:#TABLE:site:key=httpport:value#/$pkgdir\n"; #for rhels5.9
|
||||
$source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=http://'\$nextserver'$httpportsuffix/$pkgdir' >> /tmp/repos";
|
||||
$source .= "repo --name=pkg$c --baseurl=http://#TABLE:noderes:\$NODE:nfsserver#$httpportsuffix/$pkgdir\n"; #for rhels5.9
|
||||
}
|
||||
my $distrepofile="/install/postscripts/repos/$pkgdir/local-repository.tmpl";
|
||||
if( -f "$distrepofile"){
|
||||
@ -317,13 +317,13 @@ sub subvars {
|
||||
open($repofd,"<","$distrepofile");
|
||||
$repo_in_post = <$repofd>;
|
||||
close($repofd);
|
||||
$repo_in_post =~ s#baseurl=#baseurl=http://$master:$httpport/#g;
|
||||
$repo_in_post =~ s#baseurl=#baseurl=http://$master$httpportsuffix/#g;
|
||||
$writerepo .= "\ncat >/etc/yum.repos.d/local-repository-$c.repo << 'EOF'\n";
|
||||
$writerepo .="$repo_in_post\n";
|
||||
$writerepo .="EOF\n";
|
||||
}
|
||||
} elsif ($platform =~ /^(sles|suse)/) {
|
||||
my $http = "http://#TABLE:noderes:\$NODE:nfsserver#:#TABLE:site:key=httpport:value#$pkgdir";
|
||||
my $http = "http://#TABLE:noderes:\$NODE:nfsserver#$httpportsuffix/$pkgdir";
|
||||
$source .= " <listentry>
|
||||
<media_url>$http</media_url>
|
||||
<product>SuSE-Linux-pkg$c</product>
|
||||
@ -331,7 +331,7 @@ sub subvars {
|
||||
<ask_on_error config:type=\"boolean\">false</ask_on_error> <!-- available since openSUSE 11.0 -->
|
||||
<name>SuSE-Linux-pkg$c</name> <!-- available since openSUSE 11.1/SLES11 (bnc#433981) -->
|
||||
</listentry>";
|
||||
$source_in_pre .= "<listentry><media_url>http://'\$nextserver':$httpport$pkgdir</media_url><product>SuSE-Linux-pkg$c</product><product_dir>/</product_dir><ask_on_error config:type=\"boolean\">false</ask_on_error><name>SuSE-Linux-pkg$c</name></listentry>";
|
||||
$source_in_pre .= "<listentry><media_url>http://'\$nextserver'$httpportsuffix$pkgdir</media_url><product>SuSE-Linux-pkg$c</product><product_dir>/</product_dir><ask_on_error config:type=\"boolean\">false</ask_on_error><name>SuSE-Linux-pkg$c</name></listentry>";
|
||||
} elsif ($platform =~ /^sle15*/) {
|
||||
if ( -d "$pkgdir") {
|
||||
opendir(DIR,$pkgdir);
|
||||
@ -347,7 +347,7 @@ sub subvars {
|
||||
$product_name=$subdir;
|
||||
}
|
||||
if (defined($product_name) && defined($product_dir)){
|
||||
$source .="<listentry><media_url>http://XCATNEXTSERVERHOOK:$httpport$pkgdir</media_url><product>$product_name</product><product_dir>/$product_dir</product_dir></listentry>";
|
||||
$source .="<listentry><media_url>http://XCATNEXTSERVERHOOK$httpportsuffix$pkgdir</media_url><product>$product_name</product><product_dir>/$product_dir</product_dir></listentry>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -400,7 +400,7 @@ sub subvars {
|
||||
$inc =~ s/#UNCOMMENTOENABLESSH#/ /g;
|
||||
}
|
||||
|
||||
my $sles_sdk_media = "http://" . $tmpl_hash->{tftpserver}.':'.$httpport . $media_dir . "/sdk1";
|
||||
my $sles_sdk_media = "http://" . $tmpl_hash->{tftpserver}.$httpportsuffix . $media_dir . "/sdk1";
|
||||
|
||||
$inc =~ s/#SLES_SDK_MEDIA#/$sles_sdk_media/eg;
|
||||
|
||||
|
@ -2625,6 +2625,10 @@ sub populate_site_hash {
|
||||
foreach (@records) {
|
||||
$::XCATSITEVALS{ $_->{key} } = $_->{value};
|
||||
}
|
||||
|
||||
unless (exists($::XCATSITEVALS{'httpport'}) and ($::XCATSITEVALS{'httpport'} ne "")){
|
||||
$::XCATSITEVALS{'httpport'}="80";
|
||||
}
|
||||
}
|
||||
|
||||
sub populate_vpd_hash {
|
||||
|
Reference in New Issue
Block a user