Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.13.0
    • Component/s: Compute
    • Labels:
      None

      Description

      I draw inspiration from this :
      https://issues.apache.org/jira/browse/LIBCLOUD-119
      to add a little improvement to openstack driver, in fact CPU is missing in main openstack driver

        Activity

        Hide
        truijllo Carlo added a comment -

        this patch is for LIBCLOUD-325.
        A little improvement to the openstack driver, add a cpu field

        Show
        truijllo Carlo added a comment - this patch is for LIBCLOUD-325 . A little improvement to the openstack driver, add a cpu field
        Hide
        kami Tomaz Muraus added a comment -

        Thanks for your patch, I've merged it into trunk and 0.12.x branch.

        To reduce the confusion, I've changed the attribute name from "cpu" to "vcpus". The actual value reflects number of virtual CPUs / cores and not number of CPUs so calling it "vcpus" makes more sense.

        Next time please also make sure the tests pass before submitting a patch.

        Traceback (most recent call last):
        File "/w/lc/t1/libcloud/test/compute/_init_.py", line 31, in test_list_sizes_response
        sizes = self.driver.list_sizes()
        File "/w/lc/t1/libcloud/compute/drivers/openstack.py", line 224, in list_sizes
        self.connection.request('/flavors/detail').object)
        File "/w/lc/t1/libcloud/compute/drivers/openstack.py", line 793, in _to_sizes
        return [self._to_size(el) for el in elements]
        File "/w/lc/t1/libcloud/compute/drivers/openstack.py", line 801, in _to_size
        cpu=int(el.get('vcpus')),
        TypeError: int() argument must be a string or a number, not 'NoneType'

        Show
        kami Tomaz Muraus added a comment - Thanks for your patch, I've merged it into trunk and 0.12.x branch. To reduce the confusion, I've changed the attribute name from "cpu" to "vcpus". The actual value reflects number of virtual CPUs / cores and not number of CPUs so calling it "vcpus" makes more sense. Next time please also make sure the tests pass before submitting a patch. Traceback (most recent call last): File "/w/lc/t1/libcloud/test/compute/_ init _.py", line 31, in test_list_sizes_response sizes = self.driver.list_sizes() File "/w/lc/t1/libcloud/compute/drivers/openstack.py", line 224, in list_sizes self.connection.request('/flavors/detail').object) File "/w/lc/t1/libcloud/compute/drivers/openstack.py", line 793, in _to_sizes return [self._to_size(el) for el in elements] File "/w/lc/t1/libcloud/compute/drivers/openstack.py", line 801, in _to_size cpu=int(el.get('vcpus')), TypeError: int() argument must be a string or a number, not 'NoneType'

          People

          • Assignee:
            kami Tomaz Muraus
            Reporter:
            truijllo Carlo
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development