Added define which compiles python scripts.
This commit is contained in:
parent
3465159876
commit
18d88f0cd6
1 changed files with 20 additions and 0 deletions
|
@ -19,3 +19,23 @@ define python::setup::install() {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
# Compile python script into binary form.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# $name:
|
||||
# File name to compile.
|
||||
#
|
||||
# === Sample usage
|
||||
#
|
||||
# python::compile { "/usr/lib/python2.4/site-packages/dynldap.py": }
|
||||
#
|
||||
define python::compile() {
|
||||
|
||||
exec { "python -c \"import py_compile; py_compile.compile('${name}')\"":
|
||||
path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin",
|
||||
onlyif => "test '${name}' -nt '${name}c'",
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue