[openstack-puppet-modules/icehouse-epel7] Added patches for neutron, cinder and nova

Ivan Chavero ichavero at fedoraproject.org
Sat Apr 26 00:52:34 UTC 2014


commit d7b314800cbfb5104fc68b5994cbccf8c982bd82
Author: Ivan Chavero <ichavero at redhat.com>
Date:   Fri Apr 25 15:12:02 2014 -0600

    Added patches for neutron, cinder and nova
    
    Conflicts:
    	openstack-puppet-modules.spec

 0001-Fix-neutron-subnets-with-empty-values.patch |   91 +++++++++++++++++
 0001-RHEL-should-have-default-provider.patch     |   29 ++++++
 0001-Use-lioadm-as-iscsi-helper-on-RHEL-7.patch  |  114 ++++++++++++++++++++++
 openstack-puppet-modules.spec                    |   19 +++--
 4 files changed, 246 insertions(+), 7 deletions(-)
---
diff --git a/0001-Fix-neutron-subnets-with-empty-values.patch b/0001-Fix-neutron-subnets-with-empty-values.patch
new file mode 100644
index 0000000..edce6b0
--- /dev/null
+++ b/0001-Fix-neutron-subnets-with-empty-values.patch
@@ -0,0 +1,91 @@
+From 35018d26310026cce14d793ce7003448fc01bd99 Mon Sep 17 00:00:00 2001
+From: Lukas Bezdicka <lbezdick at redhat.com>
+Date: Thu, 17 Apr 2014 15:48:40 +0200
+Subject: [PATCH] Fix neutron subnets with empty values.
+
+Subnet was expended with ability to set and update parameters like
+specifing dns servers, allocation pools and also specific host routes.
+Sadly it introduced issue when calling neutron_subnet without specifying
+values for these parameters.
+Closes-Bug: #1312628
+
+Change-Id: Id1207ab793fc65c43c10afcfe2271e2c02a912d3
+---
+ lib/puppet/provider/neutron_subnet/neutron.rb     | 22 ++++++++++++++--------
+ spec/unit/provider/neutron_subnet/neutron_spec.rb |  8 ++++++++
+ 2 files changed, 22 insertions(+), 8 deletions(-)
+
+diff --git a/lib/puppet/provider/neutron_subnet/neutron.rb b/lib/puppet/provider/neutron_subnet/neutron.rb
+index 7da5701..27a4d66 100644
+--- a/lib/puppet/provider/neutron_subnet/neutron.rb
++++ b/lib/puppet/provider/neutron_subnet/neutron.rb
+@@ -50,6 +50,7 @@ Puppet::Type.type(:neutron_subnet).provide(
+ 
+   def self.parse_allocation_pool(values)
+     allocation_pools = []
++    return [] if values.empty?
+     for value in Array(values)
+       matchdata = /\{\s*"start"\s*:\s*"(.*)"\s*,\s*"end"\s*:\s*"(.*)"\s*\}/.match(value)
+       start_ip = matchdata[1]
+@@ -61,6 +62,7 @@ Puppet::Type.type(:neutron_subnet).provide(
+ 
+   def self.parse_host_routes(values)
+     host_routes = []
++    return [] if values.empty?
+     for value in Array(values)
+       matchdata = /\{\s*"destination"\s*:\s*"(.*)"\s*,\s*"nexthop"\s*:\s*"(.*)"\s*\}/.match(value)
+       destination = matchdata[1]
+@@ -164,19 +166,23 @@ Puppet::Type.type(:neutron_subnet).provide(
+   end
+ 
+   def dns_nameservers=(values)
+-    opts = ["#{name}", "--dns-nameservers", "list=true"]
+-    for value in values
+-      opts << value
++    unless values.empty?
++      opts = ["#{name}", "--dns-nameservers", "list=true"]
++      for value in values
++        opts << value
++      end
++      auth_neutron('subnet-update', opts)
+     end
+-    auth_neutron('subnet-update', opts)
+   end
+ 
+   def host_routes=(values)
+-    opts = ["#{name}", "--host-routes", "type=dict", "list=true"]
+-    for value in values
+-      opts << value
++    unless values.empty?
++      opts = ["#{name}", "--host-routes", "type=dict", "list=true"]
++      for value in values
++        opts << value
++      end
++      auth_neutron('subnet-update', opts)
+     end
+-    auth_neutron('subnet-update', opts)
+   end
+ 
+   [
+diff --git a/spec/unit/provider/neutron_subnet/neutron_spec.rb b/spec/unit/provider/neutron_subnet/neutron_spec.rb
+index 31f7d85..ae2201d 100644
+--- a/spec/unit/provider/neutron_subnet/neutron_spec.rb
++++ b/spec/unit/provider/neutron_subnet/neutron_spec.rb
+@@ -67,6 +67,14 @@ describe provider_class do
+                                             'destination=12.0.0.0/24,nexthop=10.0.0.2'])
+       provider.host_routes=(['destination=12.0.0.0/24,nexthop=10.0.0.2'])
+     end
++
++    it 'should not update if dns_nameservers are empty' do
++      provider.dns_nameservers=('')
++    end
++
++    it 'should not update if host_routes are empty' do
++      provider.host_routes=('')
++    end
+   end
+ 
+ end
+-- 
+1.8.5.3
+
diff --git a/0001-RHEL-should-have-default-provider.patch b/0001-RHEL-should-have-default-provider.patch
new file mode 100644
index 0000000..047f1af
--- /dev/null
+++ b/0001-RHEL-should-have-default-provider.patch
@@ -0,0 +1,29 @@
+From 11ec3593f677e43da49a9fb85fdda5538103c731 Mon Sep 17 00:00:00 2001
+From: Martin Magr <mmagr at redhat.com>
+Date: Fri, 25 Apr 2014 18:05:02 +0200
+Subject: [PATCH] RHEL should have default provider
+
+On RHEL-7 systemd is used and the default provider (service I suppose)
+works on older releases too.
+
+Change-Id: I4cb378350cb8de7f7c1ce1c3caacabbe682227da
+---
+ manifests/params.pp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/manifests/params.pp b/manifests/params.pp
+index d20d337..c3c8456 100644
+--- a/manifests/params.pp
++++ b/manifests/params.pp
+@@ -39,7 +39,7 @@ class nova::params {
+       $root_helper                  = 'sudo nova-rootwrap'
+       $lock_path                    = '/var/lib/nova/tmp'
+       case $::operatingsystem {
+-        'Fedora': {
++        'Fedora', 'RedHat': {
+           $special_service_provider = undef
+         }
+         default: {
+-- 
+1.8.5.3
+
diff --git a/0001-Use-lioadm-as-iscsi-helper-on-RHEL-7.patch b/0001-Use-lioadm-as-iscsi-helper-on-RHEL-7.patch
new file mode 100644
index 0000000..680b0d7
--- /dev/null
+++ b/0001-Use-lioadm-as-iscsi-helper-on-RHEL-7.patch
@@ -0,0 +1,114 @@
+From e7b7c7257069e9d641eca0b2f0ca26069cfa1bbe Mon Sep 17 00:00:00 2001
+From: Martin Magr <mmagr at redhat.com>
+Date: Fri, 25 Apr 2014 15:48:27 +0200
+Subject: [PATCH] Use lioadm as iscsi helper on RHEL 7
+
+On RHEL 7 it is necessary to use lioadm as iscsi_helper. This patch handles
+proper configuration and appropriate package installation.
+
+Change-Id: Ic3a41015c95f0b5f394d0c4b58dfc0eb10d5037d
+
+Conflicts:
+	manifests/backend/iscsi.pp
+	spec/defines/cinder_backend_iscsi_spec.rb
+---
+ manifests/params.pp                      |  9 +++++++++
+ manifests/volume/iscsi.pp                |  9 ++++++++-
+ spec/classes/cinder_volume_iscsi_spec.rb | 22 ++++++++++++++++++++--
+ 3 files changed, 37 insertions(+), 3 deletions(-)
+
+diff --git a/manifests/params.pp b/manifests/params.pp
+index 56b51ed..9d5da31 100644
+--- a/manifests/params.pp
++++ b/manifests/params.pp
+@@ -19,6 +19,8 @@ class cinder::params {
+     $tgt_package_name   = 'tgt'
+     $tgt_service_name   = 'tgt'
+     $ceph_init_override = '/etc/init/cinder-volume.override'
++    $iscsi_helper       = 'tgtadm'
++    $lio_package_name   = 'targetcli'
+ 
+   } elsif($::osfamily == 'RedHat') {
+ 
+@@ -36,6 +38,13 @@ class cinder::params {
+     $tgt_package_name   = 'scsi-target-utils'
+     $tgt_service_name   = 'tgtd'
+     $ceph_init_override = '/etc/sysconfig/openstack-cinder-volume'
++    $lio_package_name   = 'targetcli'
++
++    if $::operatingsystem == 'RedHat' and $::operatingsystemrelease >= 7 {
++      $iscsi_helper = 'lioadm'
++    } else {
++      $iscsi_helper = 'tgtadm'
++    }
+ 
+   } else {
+     fail("unsuported osfamily ${::osfamily}, currently Debian and Redhat are the only supported platforms")
+diff --git a/manifests/volume/iscsi.pp b/manifests/volume/iscsi.pp
+index 4c6e05d..0322187 100644
+--- a/manifests/volume/iscsi.pp
++++ b/manifests/volume/iscsi.pp
+@@ -2,7 +2,7 @@
+ class cinder::volume::iscsi (
+   $iscsi_ip_address,
+   $volume_group      = 'cinder-volumes',
+-  $iscsi_helper      = 'tgtadm'
++  $iscsi_helper      = $cinder::params::iscsi_helper,
+ ) {
+ 
+   include cinder::params
+@@ -38,6 +38,13 @@ class cinder::volume::iscsi (
+       }
+     }
+ 
++    'lioadm': {
++      package { 'targetcli':
++        ensure => present,
++        name   => $::cinder::params::lio_package_name,
++      }
++    }
++
+     default: {
+       fail("Unsupported iscsi helper: ${iscsi_helper}.")
+     }
+diff --git a/spec/classes/cinder_volume_iscsi_spec.rb b/spec/classes/cinder_volume_iscsi_spec.rb
+index fe0a7f7..0e7a681 100644
+--- a/spec/classes/cinder_volume_iscsi_spec.rb
++++ b/spec/classes/cinder_volume_iscsi_spec.rb
+@@ -2,8 +2,10 @@ require 'spec_helper'
+ 
+ describe 'cinder::volume::iscsi' do
+ 
+-  let :req_params do
+-    {:iscsi_ip_address => '127.0.0.2'}
++  let :req_params do {
++    :iscsi_ip_address => '127.0.0.2',
++    :iscsi_helper => 'tgtadm'
++  }
+   end
+ 
+   let :facts do
+@@ -45,4 +47,20 @@ describe 'cinder::volume::iscsi' do
+ 
+   end
+ 
++  describe 'with lioadm' do
++
++    let :params do {
++      :iscsi_ip_address => '127.0.0.2',
++      :iscsi_helper => 'lioadm'
++    }
++    end
++
++    let :facts do
++      {:osfamily => 'RedHat'}
++    end
++
++    it { should contain_package('targetcli').with_ensure('present')}
++
++  end
++
+ end
+-- 
+1.8.3.1
+
diff --git a/openstack-puppet-modules.spec b/openstack-puppet-modules.spec
index a6504c3..679ce33 100644
--- a/openstack-puppet-modules.spec
+++ b/openstack-puppet-modules.spec
@@ -37,7 +37,7 @@
 
 Name:           openstack-puppet-modules
 Version:        2014.1
-Release:        7%{?dist}
+Release:        8%{?dist}
 Summary:        Puppet modules used to deploy OpenStack
 License:        ASL 2.0 and GPLv2 and GPLv3
 
@@ -80,10 +80,8 @@ Source33:	https://github.com/packstack/puppetlabs-xinetd/archive/%{xinetd_commit
 
 Patch0:     mariadb.patch
 Patch1:     apache24.patch
-
 Patch2:     compute_driver.patch
 Patch3:     el7-nova.patch
-Patch4:     el7-cinder.patch
 Patch5:     glance.patch
 Patch6:     heat.patch
 Patch7:     neutron.patch
@@ -91,6 +89,9 @@ Patch8:     openstack.patch
 Patch9:     cinder.patch
 Patch10:    keystone.patch
 Patch11:    nova.patch
+Patch12:    0001-Fix-neutron-subnets-with-empty-values.patch
+Patch13:    0001-RHEL-should-have-default-provider.patch
+Patch14:    0001-Use-lioadm-as-iscsi-helper-on-RHEL-7.patch
 
 BuildArch:      noarch
 
@@ -148,10 +149,12 @@ cd %{_builddir}/%{name}-%{version}/puppetlabs-mysql-%{mysql_commit}
 cd %{_builddir}/%{name}-%{version}/puppet-nova-%{nova_commit}
 %patch2 -p1
 %patch3 -p1
+%patch13 -p1
 
 # puppet-cinder patches
 cd %{_builddir}/%{name}-%{version}/puppet-cinder-%{cinder_commit}
-%patch4 -p1
+%patch9 -p1
+%patch14 -p1
 
 # puppet-glance patches
 cd %{_builddir}/%{name}-%{version}/puppet-glance-%{glance_commit}
@@ -164,14 +167,12 @@ cd %{_builddir}/%{name}-%{version}/puppet-heat-%{heat_commit}
 # puppet-neutron patches
 cd %{_builddir}/%{name}-%{version}/puppet-neutron-%{neutron_commit}
 %patch7 -p1
+%patch12 -p1
 
 # puppet-openstack patches
 cd %{_builddir}/%{name}-%{version}/puppet-openstack-%{openstack_commit}
 %patch8 -p1
 
-# puppet-cinder patches
-cd %{_builddir}/%{name}-%{version}/puppet-cinder-%{cinder_commit}
-%patch9 -p1
 
 # puppet-keystone patches
 cd %{_builddir}/%{name}-%{version}/puppet-keystone-%{keystone_commit}
@@ -180,6 +181,7 @@ cd %{_builddir}/%{name}-%{version}/puppet-keystone-%{keystone_commit}
 # puppet-nova patches
 cd %{_builddir}/%{name}-%{version}/puppet-nova-%{nova_commit}
 %patch11 -p1
+%patch13 -p1
 
 find %{_builddir} -type f -name ".*" -exec rm {} +
 find %{_builddir} -size 0 -exec rm {} +
@@ -236,6 +238,9 @@ rm -f %{buildroot}/%{_datadir}/openstack-puppet/modules/nova/files/nova-novncpro
 
 
 %changelog
+* Fri Apr 25 2014 Iván Chavero <ichavero at redhat.com> - 2014.1-8
+- Added patches for neutron, cinder and nova
+
 * Tue Apr 8 2014 Martin Mágr <mmagr at redhat.com> - 2014.1-7
 - Synchronized modules with current master branch of redhat-openstack/openstack-puppet-modules
 


More information about the scm-commits mailing list