From adab82de4b1750bfbfa5303e6a844474b7ba1bec Mon Sep 17 00:00:00 2001 From: bxuxa Date: Tue, 20 Nov 2018 17:52:10 +0800 Subject: [PATCH] upgrade to travis xenial env --- .travis.yml | 6 ++--- travis.pl | 28 +++++++++++----------- xCAT-server/lib/xcat/monitoring/snmpmon.pm | 4 ++-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.travis.yml b/.travis.yml index 507fd0a77..d8f18824b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ os: linux -dist: trusty +dist: xenial sudo: required before_install: -- sudo apt-get install -y git reprepro devscripts debhelper libsoap-lite-perl libdbi-perl quilt openssh-server dpkg looptools genometools software-properties-common +- sudo apt-get install -y git fakeroot reprepro devscripts debhelper libcapture-tiny-perl libjson-perl libsoap-lite-perl libdbi-perl quilt openssh-server dpkg looptools genometools software-properties-common - perl -v -- echo "yes" | sudo cpan -f -i Capture::Tiny +#- echo "yes" | sudo cpan -f -i Capture::Tiny script: - echo $TRAVIS_BUILD_ID diff --git a/travis.pl b/travis.pl index 61b11e433..801265de6 100644 --- a/travis.pl +++ b/travis.pl @@ -271,19 +271,19 @@ sub send_back_comment{ #-------------------------------------------------------- sub build_xcat_core{ my @output; - my @cmds = ("gpg --list-keys", - "sed -i '/SignWith: /d' $ENV{'PWD'}/build-ubunturepo"); - foreach my $cmd (@cmds){ - print "[build_xcat_core] running $cmd\n"; - @output = runcmd("$cmd"); - if($::RUNCMD_RC){ - print "[build_xcat_core] $cmd ....[Failed]\n"; - send_back_comment("> **BUILD ERROR** : $cmd failed. Please click ``Details`` label in ``Merge pull request`` box for detailed information"); - return 1; - } - } + #my @cmds = ("gpg --list-keys", + # "sed -i '/SignWith: /d' $ENV{'PWD'}/build-ubunturepo"); + #foreach my $cmd (@cmds){ + # print "[build_xcat_core] running $cmd\n"; + # @output = runcmd("$cmd"); + # if($::RUNCMD_RC){ + # print "[build_xcat_core] $cmd ....[Failed]\n"; + # send_back_comment("> **BUILD ERROR** : $cmd failed. Please click ``Details`` label in ``Merge pull request`` box for detailed information"); + # return 1; + # } + #} - my $cmd = "sudo ./build-ubunturepo -c UP=0 BUILDALL=1"; + my $cmd = "sudo ./build-ubunturepo -c UP=0 BUILDALL=1 GPGSIGN=0"; @output = runcmd("$cmd"); print ">>>>>Dumper the output of '$cmd'\n"; print Dumper \@output; @@ -321,8 +321,8 @@ sub install_xcat{ my @cmds = ("cd ./../../xcat-core && sudo ./mklocalrepo.sh", "sudo chmod 777 /etc/apt/sources.list", - "sudo echo \"deb [arch=amd64] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep trusty main\" >> /etc/apt/sources.list", - "sudo echo \"deb [arch=ppc64el] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep trusty main\" >> /etc/apt/sources.list", + "sudo echo \"deb [arch=amd64] http://xcat.org/files/xcat/repos/apt/devel/xcat-dep xenial main\" >> /etc/apt/sources.list", + "sudo echo \"deb [arch=ppc64el] http://xcat.org/files/xcat/repos/apt/2.14/xcat-dep xenial main\" >> /etc/apt/sources.list", "sudo wget -q -O - \"http://xcat.org/files/xcat/repos/apt/apt.key\" | sudo apt-key add -", "sudo apt-get -qq update"); my @output; diff --git a/xCAT-server/lib/xcat/monitoring/snmpmon.pm b/xCAT-server/lib/xcat/monitoring/snmpmon.pm index 75a8f26bb..a8e35eab9 100644 --- a/xCAT-server/lib/xcat/monitoring/snmpmon.pm +++ b/xCAT-server/lib/xcat/monitoring/snmpmon.pm @@ -759,7 +759,7 @@ sub configSwitch { my $table = xCAT::Table->new('switches', -create => 0); if ($table) { my @tmp1 = $table->getAllAttribs(('switch')); - if (defined(@tmp1) && (@tmp1 > 0)) { + if (scalar @tmp1 > 0) { foreach (@tmp1) { my @switches_tmp = noderange($_->{switch}); if (@switches_tmp == 0) { push @switches_tmp, $_->{switch}; } @@ -1360,7 +1360,7 @@ sub getNodesMonServers my $table = xCAT::Table->new('switches', -create => 0); if ($table) { my @tmp1 = $table->getAllAttribs(('switch')); - if (defined(@tmp1) && (@tmp1 > 0)) { + if (scalar @tmp1 > 0) { foreach (@tmp1) { my @switches_tmp = noderange($_->{switch}); if (@switches_tmp == 0) { push @switches_tmp, $_->{switch}; }