File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ require 'puppet'
2+ pkg = Puppet ::Type . type ( :package ) . new ( :name => "virtualenv" )
3+ Facter . add ( "virtualenv_version" ) do
4+ setcode do
5+ /^(\d +\. \d +\. \d +).*$/ . match ( pkg . retrieve [ pkg . property ( :ensure ) ] ) [ 1 ]
6+ end
7+ end
Original file line number Diff line number Diff line change 1515#
1616# [*systempkgs*]
1717# Copy system site-packages into virtualenv. Default: don't
18+ # If virtualenv version < 1.7 this flag has no effect since
19+ # the system packages were not supported
1820#
1921# [*distribute*]
2022# Include distribute in the virtualenv. Default: true
8890 default => " && export http_proxy=${proxy} " ,
8991 }
9092
91- $system_pkgs_flag = $systempkgs ? {
92- false => ' ' ,
93- default => ' --system-site-packages' ,
93+ # Virtualenv versions prior to 1.7 do not support the
94+ # --system-site-packages flag, default off for prior versions
95+ if versioncmp($::virtualenv_version ,' 1.7' ) > 0 and systempkgs == true {
96+ $system_pkgs_flag = ' --system-site-packages' ,
97+ } else {
98+ $system_pkgs_flag = ' '
9499 }
95100
96101 $distribute_pkg = $distribute ? {
You can’t perform that action at this time.
0 commit comments