Extends use of ServiceProxy to more methods in HostAPI in cells
Cells prepend full cell path to the service ID before returning any
service related info. This means service ID is non numeric and can't
be cast into Service objects. In cells, service_get_all method
in HostAPI (which is used to display list of services) strips out
the cell path from received IDs, creates Service objects using
remaining numerical ID and uses a ServiceProxy to associate cell paths
Service objects.
However, other service related methods do not do so. They include:
- service_update (Used for enabling/disabling services)
- service_get_all_by_host (Used for evacuation)
These functions try to cast received service info (with alphanumeric
service IDs) into Service objects and fail with a ValueError.
This leads to API cell throwing Error 500 for service-enable,
service-disable and evacuate.
This patch extends the ServiceProxy usage to both these methods. It
also changes the corresponding HostAPI tests.
Note: The required unit-tests are manually added to the below path,
as new path for unit-tests is not present in stable/juno release.
nova/tests/compute/test_host_api.py
Reviewed: https:/ /review. openstack. org/138374 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=2da23419034 6d76725017b4ee7 570d0a7e89a91c
Committed: https:/
Submitter: Jenkins
Branch: stable/juno
commit 2da234190346d76 725017b4ee7570d 0a7e89a91c
Author: Dheeraj Gupta <email address hidden>
Date: Tue Oct 7 09:18:27 2014 +0000
Extends use of ServiceProxy to more methods in HostAPI in cells
Cells prepend full cell path to the service ID before returning any get_all_ by_host (Used for evacuation)
service related info. This means service ID is non numeric and can't
be cast into Service objects. In cells, service_get_all method
in HostAPI (which is used to display list of services) strips out
the cell path from received IDs, creates Service objects using
remaining numerical ID and uses a ServiceProxy to associate cell paths
Service objects.
However, other service related methods do not do so. They include:
- service_update (Used for enabling/disabling services)
- service_
These functions try to cast received service info (with alphanumeric
service IDs) into Service objects and fail with a ValueError.
This leads to API cell throwing Error 500 for service-enable,
service-disable and evacuate.
This patch extends the ServiceProxy usage to both these methods. It
also changes the corresponding HostAPI tests.
Note: The required unit-tests are manually added to the below path, tests/compute/ test_host_ api.py
as new path for unit-tests is not present in stable/juno release.
nova/
Conflicts:
nova/ tests/unit/ compute/ test_host_ api.py
Change-Id: Iff2707602d5fab fbe8438150b5ad7 4b3c31bb011 d2bf20c604232e4 db9747da7d)
Closes-Bug: 1361180
(cherry picked from commit fcd24c6774af0ad