Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-858

Unable to list nodes with Libvirt provider on Python 3

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Compute
    • None
    • Ubuntu 16.04.1 LTS
      Python 3.5.2
      Libcloud installed from 1a836148250ebf852a7f28e4d93007417ee7639d

    Description

      Using the list_nodes methods of the Libvirt provider driver results in an error when using Python 3. A simple script to trigger this is as follows:

      from libcloud.compute.providers import get_driver
      from libcloud.compute.types import Provider
      
      cls = get_driver(Provider.LIBVIRT)
      driver = cls('qemu:///system')
      nodes = driver.list_nodes()
      

      It results in the following error:

      Traceback (most recent call last):
        File "libcloud_list_nodes.py", line 6, in <module>
          nodes = driver.list_nodes()
        File "/home/femnad/v/libcloud3-pristine/lib/python3.5/site-packages/apache_libcloud-1.2.1-py3.5.egg/libcloud/compute/drivers/libvirt_driver.py", line 120, in list_nodes
          nodes = self._to_nodes(domains=domains)
        File "/home/femnad/v/libcloud3-pristine/lib/python3.5/site-packages/apache_libcloud-1.2.1-py3.5.egg/libcloud/compute/drivers/libvirt_driver.py", line 276, in _to_nodes
          nodes = [self._to_node(domain=domain) for domain in domains]
        File "/home/femnad/v/libcloud3-pristine/lib/python3.5/site-packages/apache_libcloud-1.2.1-py3.5.egg/libcloud/compute/drivers/libvirt_driver.py", line 276, in <listcomp>
          nodes = [self._to_node(domain=domain) for domain in domains]
        File "/home/femnad/v/libcloud3-pristine/lib/python3.5/site-packages/apache_libcloud-1.2.1-py3.5.egg/libcloud/compute/drivers/libvirt_driver.py", line 285, in _to_node
          ip_addresses = self._get_ip_addresses_for_domain(domain)
        File "/home/femnad/v/libcloud3-pristine/lib/python3.5/site-packages/apache_libcloud-1.2.1-py3.5.egg/libcloud/compute/drivers/libvirt_driver.py", line 333, in _get_ip_addresses_for_domain
          arp_table = self._parse_ip_table_arp(arp_output=stdout)
        File "/home/femnad/v/libcloud3-pristine/lib/python3.5/site-packages/apache_libcloud-1.2.1-py3.5.egg/libcloud/compute/drivers/libvirt_driver.py", line 410, in _parse_ip_table_arp
          return self._parse_mac_addr_table(arp_output, arp_regex)
        File "/home/femnad/v/libcloud3-pristine/lib/python3.5/site-packages/apache_libcloud-1.2.1-py3.5.egg/libcloud/compute/drivers/libvirt_driver.py", line 431, in _parse_mac_addr_table
          lines = cmd_output.split('\n')
      TypeError: a bytes-like object is required, not 'str'
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              femnad Fahri Cihan Demirci
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: