]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fix error string format for replication API calls
authorAlex O'Rourke <alex.orourke@hpe.com>
Fri, 9 Oct 2015 18:10:38 +0000 (11:10 -0700)
committerAlex O'Rourke <alex.orourke@hpe.com>
Fri, 9 Oct 2015 18:10:38 +0000 (11:10 -0700)
commit39309b266df19c33272079f462b64dfba126396d
treef2088ea4908db9e446371c9eac57a6a6de5302a9
parent46b69094a7a4f1cf411103971d5b606c435be80c
Fix error string format for replication API calls

enable_replication, disable_replication, and failover_replication all
raise exceptions if the volume they are being called on are not in
valid states. When that is done, the error message is not properly
formatted and looks as such:
"ERROR: Invalid volume: (u'Invalid status to enable replication. valid
states are: %(valid_states)s, current replication-state is:
%(curr_state)s.', {'curr_state': u'enabled', 'valid_states':
['disabled']}) (HTTP 400)"

The reason for this is the msg string is using a ',' instead of a '%'
to evaluate the string. When fixed, the error is displayed correctly:
"ERROR: Invalid volume: Invalid status to enable replication. valid
states are: ['disabled'], current replication-state is: enabled.
(HTTP 400)"

Change-Id: I47dcb0a7688a7d740672a75292e0bf98df1551b2
Closes-Bug: #1504633
cinder/volume/api.py