Change in osmo-gsm-tester[master]: add osmo_vty.py

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Mon Dec 7 21:45:23 UTC 2020


neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21504 )

Change subject: add osmo_vty.py
......................................................................


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21504/3/src/osmo_gsm_tester/obj/osmo_vty.py 
File src/osmo_gsm_tester/obj/osmo_vty.py:

https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21504/3/src/osmo_gsm_tester/obj/osmo_vty.py@64 
PS3, Line 64:             self.sck = None
> is socket closed whenever you set it to None? I'd prefer having an explicitly sck.close() here.
the None is just an indicator that the socket is currently not open.

socket cleanup should be explicit. i guessed sck.close() needs to happen only after sck.connect() was successful, and otherwise the socket would be implicitly closed from the ConnectionRefusedError.

from python3 docs:

 Sockets are automatically closed when they are garbage-collected, but it is recommended to close() them explicitly, or to use a with statement around them.

interesting:

  socket.close()
    Mark the socket closed. The underlying system resource (e.g. a file descriptor) is also closed when all file objects from makefile() are closed.

and

 Note
 close() releases the resource associated with a connection but does not necessarily close the connection immediately. If you want to close the connection in a timely fashion, call shutdown() before close(). 

i should anyway probably 'except' on anything, not just ConnectionRefusedError.



-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21504
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I7c17b143b7c690b8c4105ee7c6272670046fa91d
Gerrit-Change-Number: 21504
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Mon, 07 Dec 2020 21:45:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin at sysmocom.de>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201207/cc176641/attachment.htm>


More information about the gerrit-log mailing list