LIBCLOUD-858: Fix Listing Libvirt Nodes with Python 3 #894

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
@femnad
Contributor

femnad commented Oct 9, 2016

Fix Listing Libvirt Nodes with Python 3

Description

Listing nodes with the Libvirt provider fails on Python 3 because of a split operation on a bytes object where the delimiter is not a bytes object.

Use the ensure_string function from the py3 module to ensure that the output of a subprocess.Popen call is always a string for Python 2 and 3. Also add a test to convert the mock command output results to bytes objects if the active Python version is 3.

Status

  • done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation
  • Tests
  • ICLA (required for bigger changes)
@tonybaloney

This comment has been minimized.

Show comment
Hide comment
@tonybaloney

tonybaloney Oct 9, 2016

Contributor

great, thanks for also contributing the test to assert the issue exists and the change resolves it. 👍

Contributor

tonybaloney commented Oct 9, 2016

great, thanks for also contributing the test to assert the issue exists and the change resolves it. 👍

@asfgit asfgit closed this in f5ff0cf Oct 9, 2016

asfgit pushed a commit that referenced this pull request Oct 9, 2016

@femnad femnad deleted the femnad:LIBCLOUD-858_fix-libvirt-node-listing-with-python-3 branch Oct 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment