baremetal pxe driver logs exception from unlink_without_raise

Bug #1097931 reported by aeva black
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
aeva black

Bug Description

nova/virt/baremetal/pxe.py clears symlinks for the tftp configuration files before it creates new ones, but it is logging an exception if the symlink being unlinked doesn't exist. The exception is confusing since it does not indicate an error, and should not be recorded in the log.

Log:

2013-01-09 20:28:56 ERROR nova.virt.baremetal.utils [req-dee4f521-5d7d-4ce2-8402-9b7eb684561a demo demo] Failed to unlink /tftpboot/pxelinux.cfg/01-<snip>
2013-01-09 20:28:56 TRACE nova.virt.baremetal.utils Traceback (most recent call last):
2013-01-09 20:28:56 TRACE nova.virt.baremetal.utils File "/opt/stack/nova/nova/virt/baremetal/utils.py", line 45, in unlink_without_raise
2013-01-09 20:28:56 TRACE nova.virt.baremetal.utils os.unlink(path)
2013-01-09 20:28:56 TRACE nova.virt.baremetal.utils OSError: [Errno 2] No such file or directory: '/tftpboot/pxelinux.cfg/01-<snip>'
2013-01-09 20:28:56 TRACE nova.virt.baremetal.utils

Tags: baremetal
aeva black (tenbrae)
Changed in nova:
assignee: nobody → Devananda (devananda)
Revision history for this message
aeva black (tenbrae) wrote :

pxe.py is also failing to remove directories that it created under /tftpboot/ because it is calling os.unlink, instead of os.rmdir. This is a separate issue, but the fix is the same.

Changed in nova:
status: New → In Progress
Revision history for this message
aeva black (tenbrae) wrote :

My previous comment was wrong -- pxe driver is failing to delete /tftpboot/{uuid}/ directories because they are not empty, and it is failing to delete files within that directory because the file names aren't passed to pxe.deactivate_bootloader. I opened a separate bug for that:

https://bugs.launchpad.net/nova/+bug/1101048

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

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

aeva black (tenbrae)
tags: added: baremetal
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/20002
Committed: http://github.com/openstack/nova/commit/ac8a9d80d035f19c251935491d4bf5672f5e3b6b
Submitter: Jenkins
Branch: master

commit ac8a9d80d035f19c251935491d4bf5672f5e3b6b
Author: Devananda van der Veen <email address hidden>
Date: Thu Jan 17 13:30:58 2013 -0800

    Baremetal/utils should not log certain exceptions

    unlink_without_raise was logging exceptions when it failed to unlink a
    file, which is confusing since it is often called on non-existing files.

    create_link_without_raise was also logging exceptions when it failed
    to create a symlink.

    This patch corrects this behaviour; both functions now explicitly check
    for the type of error they expect, and then suppress that. If another
    type of OSError is encountered, a warning is logged. This patch also
    adds unit tests for both functions.

    fixes bug 1097931.

    Change-Id: Ie36f59dce34a6c67765770c5f968c003003acc88

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → grizzly-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-3 → 2013.1
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.