Skip to content

rpm: Work around os.path.exists not catching dirs that exist

The true cause couldn't be found (error was intermittent), but this should work around it, and if it re-emerges, we will know something new.

The error is:

0 17-05-19 00:11:26 [538/636/636] [ngi-system-x86_32] ERROR: surprise exception in sandbox 
Traceback (most recent call last):
  File "/builds/jlr/definitions/ybd/ybd/sandbox.py", line 60, in setup
    yield
  File "/builds/jlr/definitions/ybd/ybd/rpm.py", line 326, in package_rpms
    os.makedirs(rpmdb_path)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)

Having inspected the system that generated this, this is referring to whether /var/lib/rpm exists in the sandbox, and it erroneously tries to create that dir after os.path.exists() returns False. I have already checked, and /var/lib/rpm does not contain any broken symlinks, and I would have expected a permissions error to rear its head before.

Edited by Jonathan Maw

Merge request reports