Fix NamedTemporaryFile() OSError Exception
Fix NamedTemporaryFile() OSError Exception

This patch prevents NamedTemporaryFile() from throwing Exception
OSError [1] when tox executed unit test, and mocks the creation of
password file instead of really creating the same for all unit tests.

[1] Exception OSError: (2, 'No such file or directory',
    '/tmp/tmpua4JrB/tmp26KOu0') in <bound method
    _TemporaryFileWrapper.__del__ of <closed file '<fdopen>', mode
    'w+b' at 0x7f912eb46930>> ignored

Co-Authored-By: Zhenguo Niu <Niu.ZGlinux@gmail.com>
Co-Authored-By: Debayan Ray <debayan.ray@gmail.com>

Closes-Bug: 1565592
Change-Id: Id513ca6753a11e3d16aaea2b53b356f059bb35ab

SauloAislan/ironic,openstack/ironic,pshchelo/ironic,bacaldwell/ironic,SauloAislan/ironic,openstack/ironic,pshchelo/ironic,NaohiroTamura/ironic,bacaldwell/ironic,devananda/ironic,NaohiroTamura/ironic