From 03c02e70dbc084728adc6a8d6c3e65f97f8889e2 Mon Sep 17 00:00:00 2001 From: srisankethu Date: Tue, 22 Nov 2016 16:25:49 +0530 Subject: [PATCH] Fix CI Closes https://github.com/dfarrell07/puppet-opendaylight/issues/109 Change-Id: Ic4e22ba08892f73c3f33feae0262eabec769dace Signed-off-by: srisankethu Signed-off-by: Daniel Farrell --- .travis.yml | 1 - manifests/config.pp | 27 ++++++++++++++++----------- manifests/init.pp | 10 ++++++---- spec/classes/opendaylight_spec.rb | 6 +++++- 4 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index c174c64..78f0399 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: ruby bundler_args: --without local_only before_install: rm Gemfile.lock || true rvm: - - 1.9.3 - 2.0.0 - 2.1.7 - 2.2.3 diff --git a/manifests/config.pp b/manifests/config.pp index d185dcd..b20b5c9 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -82,9 +82,13 @@ class opendaylight::config { # Requires at least CentOS 7.3 for RHEL/CentOS systems if ('odl-netvirt-openstack' in $opendaylight::features) { if $opendaylight::security_group_mode == 'stateful' { - if $opendaylight::stateful_unsupported { - warning("Stateful is unsupported in ${::operatingsystemrelease} setting to 'learn'") - $sg_mode = 'learn' + if defined('$opendaylight::stateful_unsupported') { + if $opendaylight::stateful_unsupported { + warning("Stateful is unsupported in ${::operatingsystemrelease} setting to 'learn'") + $sg_mode = 'learn' + } else { + $sg_mode = 'learn' + } } else { $sg_mode = 'stateful' } @@ -92,16 +96,17 @@ class opendaylight::config { $sg_mode = $opendaylight::security_group_mode } - $odl_datastore = [ '/opt/opendaylight/etc/opendaylight', '/opt/opendaylight/etc/opendaylight/datastore', - '/opt/opendaylight/etc/opendaylight/datastore/initial', - '/opt/opendaylight/etc/opendaylight/datastore/initial/config', - ] + $odl_datastore = [ + '/opt/opendaylight/etc/opendaylight', '/opt/opendaylight/etc/opendaylight/datastore', + '/opt/opendaylight/etc/opendaylight/datastore/initial', + '/opt/opendaylight/etc/opendaylight/datastore/initial/config', + ] file { $odl_datastore: - ensure => directory, - mode => 0755, - owner => 'odl', - group => 'odl', + ensure => directory, + mode => '0755', + owner => 'odl', + group => 'odl', } -> file { 'netvirt-aclservice-config.xml': diff --git a/manifests/init.pp b/manifests/init.pp index 69d73fa..5b4a9fc 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -66,10 +66,12 @@ class opendaylight ( if $::operatingsystemmajrelease != '7' { # RHEL/CentOS versions < 7 not supported as they lack systemd fail("Unsupported OS: ${::operatingsystem} ${::operatingsystemmajrelease}") - } elsif (versioncmp($::operatingsystemrelease, '7.3') < 0) { - # Versions < 7.3 do not support stateful security groups - $stateful_unsupported = true - } + } elsif defined('::operatingsystemrelease') { + if (versioncmp($::operatingsystemrelease, '7.3') < 0) { + # Versions < 7.3 do not support stateful security groups + $stateful_unsupported = true + } + } } fedora: { # Fedora distros < 22 are EOL as of 2015-12-01 diff --git a/spec/classes/opendaylight_spec.rb b/spec/classes/opendaylight_spec.rb index 44b444c..3c21461 100644 --- a/spec/classes/opendaylight_spec.rb +++ b/spec/classes/opendaylight_spec.rb @@ -602,6 +602,7 @@ describe 'opendaylight' do :operatingsystem => operatingsystem, :operatingsystemrelease => operatingsystemrelease, :operatingsystemmajrelease => operatingsystemmajrelease, + :architecture => 'x86_64', :path => ['/usr/local/bin', '/usr/bin', '/bin'], }} @@ -626,6 +627,7 @@ describe 'opendaylight' do :operatingsystem => operatingsystem, :operatingsystemrelease => operatingsystemrelease, :operatingsystemmajrelease => operatingsystemmajrelease, + :architecture => 'x86_64', :path => ['/usr/local/bin', '/usr/bin', '/bin'], }} @@ -654,6 +656,7 @@ describe 'opendaylight' do :operatingsystem => operatingsystem, :operatingsystemrelease => operatingsystemrelease, :operatingsystemmajrelease => operatingsystemmajrelease, + :architecture => 'x86_64', :path => ['/usr/local/bin', '/usr/bin', '/bin'], }} @@ -679,6 +682,7 @@ describe 'opendaylight' do :operatingsystem => operatingsystem, :operatingsystemrelease => operatingsystemrelease, :operatingsystemmajrelease => operatingsystemmajrelease, + :architecture => 'x86_64', :path => ['/usr/local/bin', '/usr/bin', '/bin'], }} @@ -748,7 +752,7 @@ describe 'opendaylight' do # Run test that specialize in checking security groups # Note that this function is defined in spec_helper - enable_sg_tests(security_group_mode: 'stateful', osrelease: '7.2.1511') + enable_sg_tests(security_group_mode: 'stateful', osrelease: '7.3') end context 'using transparent with unsupported stateful' do -- 2.36.6