python/machine: Disable pylint warning for open() in _pre_launch
commit63c33f3c286efe4c6474b53ae97915c9d1a6923a
authorJohn Snow <jsnow@redhat.com>
Thu, 27 May 2021 21:16:49 +0000 (27 17:16 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 1 Jun 2021 20:21:21 +0000 (1 16:21 -0400)
tree757d832be80aac6051223b6244121e8b71608790
parent8825fed82a1949ed74f103c2ff26c4d71d2e4845
python/machine: Disable pylint warning for open() in _pre_launch

Shift the open() call later so that the pylint pragma applies *only* to
that one open() call. Add a note that suggests why this is safe: the
resource is unconditionally cleaned up in _post_shutdown().

_post_shutdown is called after failed launches (see launch()), and
unconditionally after every call to shutdown(), and therefore also on
__exit__.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Message-id: 20210527211715.394144-6-jsnow@redhat.com
Message-id: 20210517184808.3562549-6-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
python/qemu/machine.py