From dc9b66ef22ccce707294194a403f0965073a10ff Mon Sep 17 00:00:00 2001 From: Kamlesh Parmar Date: Sat, 6 Aug 2016 11:28:27 -0700 Subject: [PATCH] Closes-Bug: #1610573 Puppet execution stop after database completion in contrail_roles.rb. Neutron-server doesnt start due to openstack release match regexp doesnt handle centos pattern in neutron.pp. For upgrade case, need to check against installed vs what is available in repo. Change-Id: Ie8a26cdb1a80ee0c5b2c35387d3f7a3bf28fb935 --- .../contrail/lib/facter/contrail-compute-custom-facts.rb | 4 +++- .../modules/contrail/lib/facter/contrail_roles.rb | 1 - .../modules/contrail/manifests/config/neutron.pp | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/contrail/environment/modules/contrail/lib/facter/contrail-compute-custom-facts.rb b/contrail/environment/modules/contrail/lib/facter/contrail-compute-custom-facts.rb index 192f339e..bf7638dd 100755 --- a/contrail/environment/modules/contrail/lib/facter/contrail-compute-custom-facts.rb +++ b/contrail/environment/modules/contrail/lib/facter/contrail-compute-custom-facts.rb @@ -38,7 +38,9 @@ operatingsystem = Facter.value('operatingsystem') case operatingsystem when "CentOS" - Facter::Util::Resolution.exec('yum list | grep contrail-lib | awk \'{ printf $2}\' | awk -F \'.e\' \'{printf $1}\'') + # need to check installed version, one below check the version in repo + # need for upgrade check + Facter::Util::Resolution.exec('yum list installed | grep contrail-lib | awk \'{ printf $2}\' | awk -F \'.e\' \'{printf $1}\'') when "Ubuntu" Facter::Util::Resolution.exec('dpkg -l contrail-lib | grep contrail-lib | awk \'{ printf $3}\'') end diff --git a/contrail/environment/modules/contrail/lib/facter/contrail_roles.rb b/contrail/environment/modules/contrail/lib/facter/contrail_roles.rb index 028ce9b8..52a529f6 100755 --- a/contrail/environment/modules/contrail/lib/facter/contrail_roles.rb +++ b/contrail/environment/modules/contrail/lib/facter/contrail_roles.rb @@ -7,7 +7,6 @@ roles_array.each do |role| service_str = "service supervisor-" + role + " status" - puts(service_str) is_service_running = system(service_str) if role == "analytics" role = "collector" diff --git a/contrail/environment/modules/contrail/manifests/config/neutron.pp b/contrail/environment/modules/contrail/manifests/config/neutron.pp index 388dd903..1f6095dc 100644 --- a/contrail/environment/modules/contrail/manifests/config/neutron.pp +++ b/contrail/environment/modules/contrail/manifests/config/neutron.pp @@ -35,9 +35,11 @@ $database_credentials = join([$service_password, "@", $neutron_mysql_ip],'') $keystone_db_conn = join(["mysql://neutron:",$database_credentials,"/neutron"],'') - if ( $package_sku =~ /^*:12\.0.*$/) { + # sku pattern for centos is 12.0.1-1.el7.noarch. while + # sku pattern for ubuntu is 2:12.0.1-0ubuntu1~cloud0.1contrail + if ( $package_sku =~ /12\.0./) { $neutron_extensions = ":${::python_dist}/neutron_lbaas/extensions" - } elsif ( $package_sku =~ /^*:13\.0.*$/) { + } elsif ( $package_sku =~ /13\.0./) { $neutron_extensions = ":${::python_dist}/neutron_lbaas/extensions" } else { $neutron_extensions = ""