nova/network/minidns.py should avoid writing dnstest.txt in local directory

Bug #1081750 reported by Davanum Srinivas (DIMS)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Davanum Srinivas (DIMS)

Bug Description

Note from David Ripton in a code review:

David Ripton 11:29 AM

Not a big fan of just dropping dnstest.txt into the current directory then deleting it. There's a chance, albeit small, that the user has a file with that name. And there's also a chance that the current directory is not writable. It would be better to use the tempfile module to created a guaranteed unique filename in a should-be-usable temporary directory.

tags: added: low-hanging-fruit
Michael Still (mikal)
Changed in nova:
status: New → Triaged
importance: Undecided → High
Changed in nova:
assignee: nobody → alberto besana (alberto-besana)
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

alberto, i already have a fix in this review - https://review.openstack.org/#/c/16535/

Revision history for this message
alberto besana (alberto-besana) wrote :

Ok., I see you used tmpfile in MiniDNS class.
Should you assign the bug to yourself so nobody else will take it?

Changed in nova:
assignee: alberto besana (alberto-besana) → nobody
Changed in nova:
assignee: nobody → Davanum Srinivas (dims-v)
status: Triaged → In Progress
Changed in nova:
status: In Progress → Confirmed
assignee: Davanum Srinivas (dims-v) → nobody
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/16950

Changed in nova:
assignee: nobody → Davanum Srinivas (dims-v)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit b6acf11addb9d5bc30a981d8c21c1f34747fa5d5
Author: Davanum Srinivas <email address hidden>
Date: Mon Nov 26 21:38:10 2012 -0500

    Fix test suite to use MiniDNS

    MiniDNS changes:

    * In create_entry/delete_entry, if we don't get a name
    then we throw an exception

    * In get_entries_by_address, filter out duplicates

    * Add a log.warn in addition to throwing an exception.

    Test Suite changes:

    * Updates base TestCase to use MiniDNS instead of the default DNSDriver.

    * Make sure we cleanup the dnstest.txt and the temporary directory
      in TestCase.tearDown()

    * Update a few tests to pass in display_name

    Fixes LP Bug #1081750

    Change-Id: Ia8d80102deaeaaac166ab50bbd47279d72d1e389

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