From 66c436bc2f06c5a71d79c674697394a11ec227f9 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 6 May 2014 16:23:27 +0200 Subject: [PATCH] Use stdlib to manage OVS package OVS package is managed by both OVS agent and ML2 plugin, which could cause a dupplicate resource error. Using stdlib would fix the problem. Closes-bug #1316623 Change-Id: Icfb8d9e5b077845edd726e92576f36189c6b7553 --- manifests/agents/ovs.pp | 10 ++++------ manifests/plugins/ml2.pp | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/manifests/agents/ovs.pp b/manifests/agents/ovs.pp index afcb85454..289f67f17 100644 --- a/manifests/agents/ovs.pp +++ b/manifests/agents/ovs.pp @@ -124,12 +124,10 @@ Package['neutron-plugin-ovs'] -> Neutron_plugin_ovs<||> Package['neutron-plugin-ovs'] -> Service['ovs-cleanup-service'] - if ! defined(Package['neutron-plugin-ovs']) { - package { 'neutron-plugin-ovs': - ensure => $package_ensure, - name => $::neutron::params::ovs_server_package, - } - } + ensure_resource('package', 'neutron-plugin-ovs', { + ensure => $package_ensure, + name => $::neutron::params::ovs_server_package, + }) } if $manage_service { diff --git a/manifests/plugins/ml2.pp b/manifests/plugins/ml2.pp index 49ff705ec..cde5c7fea 100644 --- a/manifests/plugins/ml2.pp +++ b/manifests/plugins/ml2.pp @@ -158,10 +158,10 @@ # Specific plugin configuration if ('openvswitch' in $mechanism_drivers) { if ($::osfamily == 'RedHat') { - package { 'neutron-plugin-ovs': + ensure_resource('package', 'neutron-plugin-ovs', { ensure => present, name => $::neutron::params::ovs_server_package, - } + }) Package['neutron-plugin-ovs'] -> Neutron_plugin_ovs<||> } if ('l2population' in $mechanism_drivers) {