[ovs-dev] [bug9769 1/4] python socket_util: Don't try to unbind None bind_path.

Ethan Jackson ethan at nicira.com
Wed Mar 7 16:14:43 PST 2012


Looks good, thanks.

Ethan

On Wed, Mar 7, 2012 at 15:46, Ben Pfaff <blp at nicira.com> wrote:
> This bug is not exposed in the current tree, because no existing caller
> passes None as bind_path.
>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  python/ovs/socket_util.py |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/python/ovs/socket_util.py b/python/ovs/socket_util.py
> index 83c8204..0a26c5d 100644
> --- a/python/ovs/socket_util.py
> +++ b/python/ovs/socket_util.py
> @@ -1,4 +1,4 @@
> -# Copyright (c) 2010 Nicira Networks
> +# Copyright (c) 2010, 2012 Nicira Networks
>  #
>  # Licensed under the Apache License, Version 2.0 (the "License");
>  # you may not use this file except in compliance with the License.
> @@ -69,11 +69,11 @@ def make_unix_socket(style, nonblock, bind_path, connect_path):
>         return 0, sock
>     except socket.error, e:
>         sock.close()
> -        try:
> -            os.unlink(bind_path)
> -        except OSError, e:
> -            pass
>         if bind_path is not None:
> +            try:
> +                os.unlink(bind_path)
> +            except OSError, e:
> +                pass
>             ovs.fatal_signal.add_file_to_unlink(bind_path)
>         return get_exception_errno(e), None
>
> --
> 1.7.2.5
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list