[Lsb-messages] /var/www/bzr/lsb/devel/puppet-lsb r50: Restructure how the Python repo is done for virtualenv/pip.
Jeff Licquia
licquia at linuxfoundation.org
Wed Jan 25 22:15:34 UTC 2012
------------------------------------------------------------
revno: 50
committer: Jeff Licquia <licquia at linuxfoundation.org>
branch nick: puppet-lsb
timestamp: Wed 2012-01-25 17:15:34 -0500
message:
Restructure how the Python repo is done for virtualenv/pip.
added:
modules/python/files/
modules/python/files/devel_languages_python.repo
modified:
modules/python/manifests/virtualenv.pp
-------------- next part --------------
=== added directory 'modules/python/files'
=== added file 'modules/python/files/devel_languages_python.repo'
--- a/modules/python/files/devel_languages_python.repo 1970-01-01 00:00:00 +0000
+++ b/modules/python/files/devel_languages_python.repo 2012-01-25 22:15:34 +0000
@@ -0,0 +1,9 @@
+[devel_languages_python]
+name=Python and Python Modules (SLE_11)
+enabled=1
+autorefresh=1
+baseurl=http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11/
+type=rpm-md
+gpgcheck=1
+gpgkey=http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11/repodata/repomd.xml.key
+keeppackages=0
=== modified file 'modules/python/manifests/virtualenv.pp'
--- a/modules/python/manifests/virtualenv.pp 2012-01-25 19:52:50 +0000
+++ b/modules/python/manifests/virtualenv.pp 2012-01-25 22:15:34 +0000
@@ -1,29 +1,33 @@
class python::virtualenv inherits python {
+ # These packages aren't available in SLES 11, so we'll need
+ # to add the repos first.
+
+ $sles11obsrepo = "$operatingsystem-$operatingsystemrelease" ? {
+ /^SLES-11(\.[0-9])?$/ => File['/etc/zypp/repos.d/devel_languages_python.repo'],
+ default => undef,
+ }
+
package { 'python-virtualenv':
- ensure => present,
- before => Exec['add-python-zypper-repo'],
+ ensure => present,
+ require => $sles11obsrepo,
}
package { 'python-pip':
ensure => present,
- before => Exec['add-python-zypper-repo'],
- }
-
- # These packages aren't available in SLES 11, so we'll need
- # to add the repos first.
-
- $skipsles11obs = "$operatingsystem-$operatingsystemrelease" ? {
- /^SLES-11(\.[0-9])?$/ => false,
- default => true,
- }
-
- exec { 'add-python-zypper-repo':
- command => 'zypper addrepo -f http://download.opensuse.org/repositories/devel:/languages:/python/SLE_11/devel:languages:python.repo && zypper --gpg-auto-import-keys refresh',
- path => [ '/bin', '/sbin', '/usr/bin', '/usr/sbin' ],
+ require => $sles11obsrepo,
+ }
+
+ file { "/etc/zypp/repos.d/devel_languages_python.repo":
+ source => "puppet:///modules/bzr/devel_languages_python.repo",
+ notify => Exec['refresh-zypper-keys'],
+ }
+
+ exec { 'refresh-zypper-keys-for-python':
+ command => 'zypper --gpg-auto-import-keys refresh',
+ path => [ '/usr/sbin', '/usr/bin', '/bin', '/sbin' ],
refreshonly => true,
logoutput => true,
- noop => $skipsles11obs,
}
}
More information about the lsb-messages
mailing list