tripleoclient package build fails trying to unlink a /tmp file during testing

Bug #1789506 reported by Alex Schultz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Sergii Golovatiuk

Bug Description

Related to https://review.openstack.org/#/c/586538/, seen in package builds failing when trying to remove the mocked temp file.

DEBUG: ======================================================================
DEBUG: FAIL: tripleoclient.tests.test_utils.TestRunAnsiblePlaybook.test_subprocess_error
DEBUG: tags: worker-2
DEBUG: ----------------------------------------------------------------------
DEBUG: Traceback (most recent call last):
DEBUG: File "/usr/lib/python3.6/site-packages/mock/mock.py", line 1305, in patched
DEBUG: return func(*args, **keywargs)
DEBUG: File "/builddir/build/BUILD/python-tripleoclient-10.5.1.dev11/tripleoclient/tests/test_utils.py", line 71, in test_subprocess_error
DEBUG: 'localhost,'
DEBUG: File "/usr/lib64/python3.6/unittest/case.py", line 750, in assertRaises
DEBUG: return context.handle('assertRaises', args, kwargs)
DEBUG: File "/usr/lib64/python3.6/unittest/case.py", line 195, in handle
DEBUG: callable_obj(*args, **kwargs)
DEBUG: File "/builddir/build/BUILD/python-tripleoclient-10.5.1.dev11/tripleoclient/utils.py", line 117, in run_ansible_playbook
DEBUG: cleanup and os.unlink(tmp_config)
DEBUG: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/fooBar.cfg'

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/597307

Changed in tripleo:
status: Triaged → In Progress
Changed in tripleo:
assignee: Alex Schultz (alex-schultz) → Sergii Golovatiuk (sgolovatiuk)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (master)

Reviewed: https://review.openstack.org/597307
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=6e6ad0a8cea3eebe7c4ebfba01b3d7d12384f2d4
Submitter: Zuul
Branch: master

commit 6e6ad0a8cea3eebe7c4ebfba01b3d7d12384f2d4
Author: Alex Schultz <email address hidden>
Date: Tue Aug 28 16:54:33 2018 -0600

    Properly mock unlink

    I5de4d68cc2669d37e7a667209423b9ac842136ff added these tests but did not
    properly mock the unlink that can be triggered. This change mocks the
    os.unlink so it doesn't try to remove our mocked file when the tests
    run.

    Co-authored-by: Sergii Golovatiuk <email address hidden>

    Change-Id: Ica28227b011255c23e677539c5e3df33f556e1b7
    Closes-Bug: #1789506

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-tripleoclient (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/605038

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-tripleoclient (stable/rocky)

Reviewed: https://review.openstack.org/605038
Committed: https://git.openstack.org/cgit/openstack/python-tripleoclient/commit/?id=2565aef537cd32c32d08163c8c4fe52c945fae44
Submitter: Zuul
Branch: stable/rocky

commit 2565aef537cd32c32d08163c8c4fe52c945fae44
Author: Alex Schultz <email address hidden>
Date: Tue Aug 28 16:54:33 2018 -0600

    Properly mock unlink

    I5de4d68cc2669d37e7a667209423b9ac842136ff added these tests but did not
    properly mock the unlink that can be triggered. This change mocks the
    os.unlink so it doesn't try to remove our mocked file when the tests
    run.

    Co-authored-by: Sergii Golovatiuk <email address hidden>

    Change-Id: Ica28227b011255c23e677539c5e3df33f556e1b7
    Closes-Bug: #1789506
    (cherry picked from commit 6e6ad0a8cea3eebe7c4ebfba01b3d7d12384f2d4)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 11.0.0

This issue was fixed in the openstack/python-tripleoclient 11.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tripleoclient 10.6.1

This issue was fixed in the openstack/python-tripleoclient 10.6.1 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.