[OE-core] [PATCHv2 1/2] oeqa/utils: added new networke module
Benjamin Esquivel
benjamin.esquivel at linux.intel.com
Mon Feb 15 19:48:15 UTC 2016
Hi Paco, please fix the typo in the subject as it is the typo of the
commit title as well.
Check my other comments below and re-send.
On Mon, 2016-02-15 at 13:10 -0600, Francisco Pedraza wrote:
> A network module was added, and will contain network utility funcions
> for now.
fix typo in 'functions'
> with get_free_port that returns availabe network port in the system.
fix typo in 'available'
>
> Signed-off-by: Francisco Pedraza <
> francisco.j.pedraza.gonzalez at intel.com>
> ---
> meta/lib/oeqa/utils/network.py | 8 ++++++++
> 1 file changed, 8 insertions(+)
> create mode 100644 meta/lib/oeqa/utils/network.py
>
> diff --git a/meta/lib/oeqa/utils/network.py
> b/meta/lib/oeqa/utils/network.py
> new file mode 100644
> index 0000000..2768f6c
> --- /dev/null
> +++ b/meta/lib/oeqa/utils/network.py
> @@ -0,0 +1,8 @@
> +import socket
> +
> +def get_free_port():
> + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> + s.bind(('', 0))
> + addr = s.getsockname()
> + s.close()
> + return addr[1]
> --
> 2.5.0
>
More information about the Openembedded-core
mailing list