When using pty=true, removing files using sudo may request confirmation,
which will hang the connection.
Similarly, sometimes assumptions about file existence may be wrong and
in those cases it seems better to continue on as long as the file does
not exist, so -f makes sense there, too.
On Fedora 20 virtual machines biosdevname command
'Returns 4 if running in a virtual machine.'
This patch:
- Uses the biosdevname command return value to detect if virtual
- Uses /sys/net to get interface names - Might be better solution
- Leaves unchanged the original 'bare metal' case - I wonder what for
though?
Tested with Fedora Cloud image adapted for vagrant-libvirt
Fixes issue #4104
I don't use `activated` here because I'd really like to optimize
performance as much as possible, and loading files from disk is
generally slow. So instead of using `activated` I load the file at the
last possible moment which is when the exact class is being requested.
I don't think many people will do this outside of the core, and I'm not
too concerned.