The problem in Ironic appears to be that the mock is being created too early, so changes in the library behavior are invoking os.path.exists() more often than expected. I suggest moving the decorator that mocks out os.path.exists() to be a context manager inside the test function around the call where the mock is actually needed.
The problem in Ironic appears to be that the mock is being created too early, so changes in the library behavior are invoking os.path.exists() more often than expected. I suggest moving the decorator that mocks out os.path.exists() to be a context manager inside the test function around the call where the mock is actually needed.