From 43937f00ea20b8b6a927b200cf139f761437d8ff Mon Sep 17 00:00:00 2001 From: Clayton O'Neill Date: Tue, 6 Dec 2016 20:56:40 +0000 Subject: [PATCH] Fix python-virtualenv references for puppet4 In order for this module to be used with puppet-python on puppet4, we need to reference the virtualenv package by title ("virtualenv") instead of by name ("python-virtualenv"). Change-Id: I24d40a499a805d8cdc1024e533ba8500115e4ea2 --- manifests/alarmdefs.pp | 11 +++++++++-- manifests/notification.pp | 11 +++++++++-- manifests/vertica/config.pp | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/manifests/alarmdefs.pp b/manifests/alarmdefs.pp index 16d452d..b04ad48 100644 --- a/manifests/alarmdefs.pp +++ b/manifests/alarmdefs.pp @@ -65,7 +65,14 @@ class monasca::alarmdefs( $sql_port = $::monasca::params::sql_port if $install_python_deps { - package { ['python-virtualenv', 'python-dev']: + # Name virtualenv instead of python-virtualenv for compat with puppet-python + package { 'virtualenv': + ensure => $python_dep_ensure, + name => 'python-virtualenv', + before => Python::Virtualenv[$virtual_env], + } + + package { 'python-dev': ensure => $python_dep_ensure, before => Python::Virtualenv[$virtual_env], } @@ -75,7 +82,7 @@ class monasca::alarmdefs( owner => 'root', group => 'root', before => [Exec[$script], File[$script]], - require => [Package['python-virtualenv'],Package['python-dev']], + require => [Package['virtualenv'],Package['python-dev']], } file { $script: diff --git a/manifests/notification.pp b/manifests/notification.pp index 0fec7dd..1c88dca 100644 --- a/manifests/notification.pp +++ b/manifests/notification.pp @@ -115,7 +115,14 @@ class monasca::notification( $startup_script = '/etc/init/monasca-notification.conf' if $install_python_deps { - package { ['python-virtualenv', 'python-dev']: + # Name virtualenv instead of python-virtualenv for compat with puppet-python + package { 'virtualenv': + ensure => $python_dep_ensure, + name => 'python-virtualenv', + before => Python::Virtualenv[$virtual_env], + } + + package { 'python-dev': ensure => $python_dep_ensure, before => Python::Virtualenv[$virtual_env], } @@ -124,7 +131,7 @@ class monasca::notification( python::virtualenv { $virtual_env : owner => 'root', group => 'root', - require => [Package['python-virtualenv'],Package['python-dev']], + require => [Package['virtualenv'],Package['python-dev']], } python::pip { 'monasca-notification' : diff --git a/manifests/vertica/config.pp b/manifests/vertica/config.pp index 05f69f5..a919596 100644 --- a/manifests/vertica/config.pp +++ b/manifests/vertica/config.pp @@ -157,7 +157,7 @@ class monasca::vertica::config ( owner => 'root', group => 'root', before => [File[$prune_script], File[$partition_drop_script]], - require => [Package['python-virtualenv'],Package['python-dev']], + require => [Package['virtualenv'],Package['python-dev']], } file { $prune_script: