2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-01 00:57:37 +00:00

Change the auto-detect for copycds to be a little more generic for RHEL ISOs (#3416)

* Change the auto-detect for copycds to be a little more generic

* Fix type and use scalar to count number of words in the discinfo description
This commit is contained in:
Victor Hu
2017-07-13 18:19:49 -04:00
committed by yangsong
parent d3b728351f
commit 7d72c6d832

View File

@@ -2151,12 +2151,8 @@ sub copycd
my $installroot = "/install";
my $sitetab = xCAT::Table->new('site');
require xCAT::data::discinfo;
#if ($sitetab)
#{
# (my $ref) = $sitetab->getAttribs({key => 'installdir'}, 'value');
my @ents = xCAT::TableUtils->get_site_attribute("installdir");
my $site_ent = $ents[0];
if (defined($site_ent))
@@ -2241,18 +2237,14 @@ sub copycd
elsif ($desc =~ /Red Hat Enterprise Linux/)
{
#
# Attempt to auto-detect for RHEL OS.
# RHEL 7.3 description is: Red Hat Enterprise Linux 7.3
# Attempt to auto-detect for RHEL OS, the last element has typically been the version
#
my @rhel_version = split / /, $desc;
#
# auto-detect pegas beta ISOs
#
if ( $rhel_version[4] =~ "Pegas") {
$distname = "rhels" . $rhel_version[5] . "-pegas";
if (scalar @rhel_version > 5) {
$distname = "rhels" . $rhel_version[-1] . "-" . lc($rhel_version[4]);
}
else {
$distname = "rhels" . $rhel_version[4];
$distname = "rhels" . $rhel_version[-1];
}
open($dinfo, $mntpath . "/.treeinfo");
while (<$dinfo>) {