21 lines
657 B
Ruby
21 lines
657 B
Ruby
Facter.add('pythonsitedir') do
|
|
setcode do
|
|
if File.exists?('/usr/local/bin/python')
|
|
pythonbin='/usr/local/bin/python'
|
|
else
|
|
pythonbin='python'
|
|
end
|
|
Facter::Util::Resolution.exec("#{pythonbin} -c 'from distutils.sysconfig import get_python_lib; print get_python_lib()'")
|
|
end
|
|
end
|
|
|
|
Facter.add('pythonversion') do
|
|
setcode do
|
|
if File.exists?('/usr/local/bin/python')
|
|
pythonbin='/usr/local/bin/python'
|
|
else
|
|
pythonbin='python'
|
|
end
|
|
Facter::Util::Resolution.exec("#{pythonbin} -c 'import platform; print platform.python_version()'")
|
|
end
|
|
end
|