]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Use get_by_args instead of host_and_topic
authorJohn Griffith <john.griffith8@gmail.com>
Wed, 2 Mar 2016 04:03:33 +0000 (04:03 +0000)
committerJohn Griffith <john.griffith8@gmail.com>
Thu, 3 Mar 2016 16:11:52 +0000 (09:11 -0700)
commitcd8e3c397877f25b3628b501744acd124843518e
treec73c18d3e466a53e49cb359ce217bae440f56f5a
parent6fa468270c670a80829066ad2b811b61e5c2ab98
Use get_by_args instead of host_and_topic

The replication v2.1 code (cheesecake) requires a number
of service queries.  The default by_host_and_topic however
doesn't include an interface to get disabled services which
is required at times.

Rather than adding a new version of get_by_host_and_topic and
introduce the arg, we probably shouldn't have been using this
particular query at all.  The only service we're interested in
is the cinder-volume service, granted in most cases volume_topic
is set to this as a default but we shouldn't be relying on it.

This patch changes the get_by_host_and_topic to use the more
appropriate (in this case) get_by_args and specifically requests
the cinder-volume binary.

Note that for manage_existing, we check the resturned service and
ensure that it disabled == False, otherwise we raise an exception.

Change-Id: I2e8c5142c589af6c1ddadeb661f86e7194faac7a
Closes-Bug: #1552006
cinder/tests/unit/api/contrib/test_snapshot_manage.py
cinder/volume/api.py
cinder/volume/manager.py