socket.close should be called directly

Bug #1666117 reported by Takanori Miyagishi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-fujitsu
New
Low
Takanori Miyagishi

Bug Description

The "disconnect" method is defined at common/ovsdb/base_connection and the method calls socket.close() only.

However socket.close() returns None regardless connection is established or not. Therefore, the method is actually meaningless. socket.close should be called directly

The following codes and result shows socket.close finished without any exceptions when socket is not established:

- Code
```
import socket

testsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
    res = testsocket.close()
except:
    print "exception is occurred."
else:
    print "exception is not occurred."
```

- Result
$ python2.7 ./socket_test.py
exception is not occurred.

Changed in networking-fujitsu:
importance: Undecided → Low
description: updated
Changed in networking-fujitsu:
assignee: nobody → Takanori Miyagishi (miyagishi-t)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.