Commit 4b84b1ff authored by Julien Muchembled's avatar Julien Muchembled

randomsleep: cleanup

parent eb4fc00a
Pipeline #6294 failed with stage
in 0 seconds
...@@ -7,16 +7,16 @@ extends = ...@@ -7,16 +7,16 @@ extends =
recipe = slapos.recipe.build recipe = slapos.recipe.build
location = ${buildout:parts-directory}/${:_buildout_section_name_} location = ${buildout:parts-directory}/${:_buildout_section_name_}
bin_dir = ${buildout:bin-directory} bin_dir = ${buildout:bin-directory}
bash_script_code = bash_script_code =
if [ "$#" -ne 1 ]; then if [ "$#" -ne 1 ]; then
echo "usage: randomsleep maxseconds" echo "usage: randomsleep maxseconds"
exit exit
fi fi
${coreutils:location}/bin/sleep $((RANDOM % $1)).$((RANDOM % 100)) exec ${coreutils:location}/bin/sleep $((RANDOM * $1 >> 15)).$((RANDOM * 100 >> 15))
wrapper_script_code = wrapper_script_code =
#!${bash:location}/bin/bash #!${bash:location}/bin/bash
${bash:location}/bin/bash ${:location}/randomsleep.bash "$@" . ${:location}/randomsleep.bash
script = script =
os.makedirs(self.options['location']) os.makedirs(self.options['location'])
bash_script_path = os.path.join(self.options['location'], 'randomsleep.bash') bash_script_path = os.path.join(self.options['location'], 'randomsleep.bash')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment