Skip to content

Commit

Permalink
Removed SHA calculation from requirements and applied the audit optio…
Browse files Browse the repository at this point in the history
…n the requirements file resource which should do exaxtly the same out of the box
  • Loading branch information
schacki committed May 20, 2013
1 parent d12046e commit 7aeaece
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions manifests/requirements.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
default => "--proxy=${proxy}",
}

$req_crc = "${requirements}.sha1"

# This will ensure multiple python::virtualenv definitions can share the
# the same requirements file.
if !defined(File[$requirements]) {
Expand All @@ -58,28 +56,20 @@
mode => '0644',
owner => $owner,
group => $group,
audit => content,
replace => false,
content => '# Puppet will install and/or update pip packages listed here',
}
}

# SHA1 checksum to detect changes
exec { "python_requirements_check_${name}":
provider => shell,
command => "sha1sum ${requirements} > ${req_crc}",
unless => "sha1sum -c ${req_crc}",
user => $owner,
require => File[$requirements],
}

exec { "python_requirements_update_${name}":
exec { "python_requirements${name}":
provider => shell,
command => "${pip_env} install ${proxy_flag} -Ur ${requirements}",
command => "${pip_env} install ${proxy_flag} -r ${requirements}",
cwd => $cwd,
refreshonly => true,
timeout => 1800,
user => $owner,
subscribe => Exec["python_requirements_check_${name}"],
subscribe => File[$requirements],
}

}

0 comments on commit 7aeaece

Please sign in to comment.