Skip to content
Snippets Groups Projects
  1. Jan 10, 2022
    • John Snow's avatar
      python: update type hints for mypy 0.930 · 366d3315
      John Snow authored
      
      Mypy 0.930, released Dec 22, changes the way argparse objects are
      considered. Crafting a definition that works under Python 3.6 and an
      older mypy alongside newer versions simultaneously is ... difficult,
      so... eh. Stub it out with an 'Any' definition to get the CI moving
      again.
      
      Oh well.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarBeraldo Leal <bleal@redhat.com>
      Message-id: 20220110191349.1841027-4-jsnow@redhat.com
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      366d3315
    • John Snow's avatar
      Python/aqmp: fix type definitions for mypy 0.920 · 42d73f28
      John Snow authored
      
      0.920 (Released 2021-12-15) is not entirely happy with the
      way that I was defining _FutureT:
      
      qemu/aqmp/protocol.py:601: error: Item "object" of the upper bound
      "Optional[Future[Any]]" of type variable "_FutureT" has no attribute
      "done"
      
      Update it with something a little mechanically simpler that works better
      across a wider array of mypy versions.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Message-id: 20220110191349.1841027-3-jsnow@redhat.com
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      42d73f28
    • John Snow's avatar
      python/aqmp: use absolute import statement · f75b20e4
      John Snow authored
      
      pylint's dependency astroid appears to have bugs in 2.9.1 and 2.9.2 (Dec
      31 and Jan 3) that appear to erroneously expect the qemu namespace to
      have an __init__.py file. astroid 2.9.3 (Jan 9) avoids that problem, but
      appears to not understand a relative import within a namespace package.
      
      Update the relative import - it was worth changing anyway, because these
      packages will eventually be packaged and distributed separately.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarBeraldo Leal <bleal@redhat.com>
      Message-id: 20220110191349.1841027-2-jsnow@redhat.com
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      f75b20e4
  2. Nov 22, 2021
  3. Nov 16, 2021
    • John Snow's avatar
      python/aqmp: fix ConnectError string method · 25de7f50
      John Snow authored
      
      When ConnectError is used to wrap an Exception that was initialized
      without an error message, we are treated to a traceback with a rubbish
      line like this:
      
      ... ConnectError: Failed to establish session:
      
      Correct this to use the name of an exception as a fallback message:
      
      ... ConnectError: Failed to establish session: EOFError
      
      Better!
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reported-by: default avatarThomas Huth <thuth@redhat.com>
      Tested-by: default avatarThomas Huth <thuth@redhat.com>
      Message-id: 20211111143719.2162525-3-jsnow@redhat.com
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      25de7f50
    • John Snow's avatar
      python/aqmp: Fix disconnect during capabilities negotiation · f26bd6ff
      John Snow authored
      
      If we receive ConnectionResetError (ECONNRESET) while attempting to
      perform capabilities negotiation -- prior to the establishment of the
      async reader/writer tasks -- the disconnect function is not aware that
      we are in an error pathway.
      
      As a result, when attempting to close the StreamWriter, we'll see the
      same ConnectionResetError that caused us to initiate a disconnect in the
      first place, which will cause the disconnect task itself to fail, which
      emits a CRITICAL logging event.
      
      I still don't know if there's a smarter way to check to see if an
      exception received at this point is "the same" exception as the one that
      caused the initial disconnect, but for now the problem can be avoided by
      improving the error pathway detection in the exit path.
      
      Reported-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Tested-by: default avatarThomas Huth <thuth@redhat.com>
      Message-id: 20211111143719.2162525-2-jsnow@redhat.com
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      f26bd6ff
  4. Nov 08, 2021
  5. Nov 01, 2021
  6. Oct 12, 2021
  7. Sep 27, 2021
Loading