xenapi: Pass string arguments to popen

The current BitTorrent code was passing integer arguments to `make_subprocess`
which would in turn pass those to `popen`. This would cause a failure because
the semantics of the underlying `execve` function is to only accept a list of
strings.

The solution is to cast the arguments to a string before passing them into
`make_subrpocess`.

Fixes bug 1201594

Change-Id: I8372795ca032420641c449cb07bb47f9252ff4ef
Fix iptables rules when metadata_host=127.0.0.1

When metadata_host is set to 127.0.0.1 metdata_forward will use the
REDIRECT target instead of the DNAT target in iptables rules. The
REDIRECT target results in an implicit DNAT to the primary address
of the incoming interface. As a result requests coming in from VMs
will have a destination address of the gateway brought up by
nova-network.

metadate_accept will now allow traffic destinatined for any local
address on the metadata_port when metadata_host is set to
127.0.0.1.

Change-Id: I877befe6f7c1020d2160194b6f6cab8297cb086c
Fixes: bug #1202356
Fix failing network manager unit tests

* Instance uuid was not returned by the mocked methods of some
  network manager unit tests causing them to fail with KeyError.

Fixes bug #1204810

Change-Id: Iee04872ea954c2c59b1bf24e7cb0058c59ae8a84
Fix leaky network tests

`test_networks.py:test_validate_instance_zone_for_dns_domain` was setting a
config in a way such that it could leak to other tests: using CONF.foo instead
of self.flags(foo=X).

This would cause other tests to break in non-determinstic ways, hence it
landing in trunk (order of tests running mattered!).

The test succeeds with the line removed, meaning it was probably only relevant
in an earlier version of the code, so the solution is to remove it.

Fixes bug 1205034

Change-Id: Iaa143a215e285d9b97c10d81bd9916ed3feeb04b
Merge "Fix iptables rules when metadata_host=127.0.0.1"
Merge "xenapi: Pass string arguments to popen"
Merge "Fix leaky network tests"
Merge "Fix failing network manager unit tests"