Server Automation Practitioners Forum

Bug in manage_boot_clients_script

Regular Contributor.

Bug in manage_boot_clients_script

I found a bug in "manage_boot_clients_script" exploited by running multiple simultaneous instances of the script.  At least one instance will fail with the following error:


"/opsw/apx/runtime/script/osprov.manage_boot_clients_script/bin/", line 746, in runIntegrationHook tempdir = getOutputDir(results) File "/opsw/apx/runtime/script/osprov.manage_boot_clients_script/bin/", line 732, in getOutputDir os.makedirs(outputdir) File "/opt/opsware/ogfsutils/lib/python2.4/", line 159, in makedirs mkdir(name, mode) OSError: [Errno 17] File exists: '/home/hpoo/.mbc/1398715579.35' ;}

The root cause is in a function around line 732 of "" where a timestamp is used to create a temporary directory.  The time resolution appears to get truncated to tenths of a second, which negates some of the execution delays creating different values between instances.  The end result is occasional and unreproduceable failures.


I devised a workaround to pause for a random period of time before calling the script:


sleep 1.$(((RANDOM % 100) + 1)) && /opsw/apx/bin/osprov/manage_boot_clients_script


Hopefully this helps someone else!