]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Rtstool sets wrong exception message on save
authorGorka Eguileor <geguileo@redhat.com>
Thu, 18 Feb 2016 12:51:40 +0000 (13:51 +0100)
committerGorka Eguileor <geguileo@redhat.com>
Thu, 18 Feb 2016 12:51:40 +0000 (13:51 +0100)
commit1e472e4bb3d3c353bbec6e5e0fb2e16e7c48f1fe
treec35d44cb99502016d6ded7d341da76b10a35c135
parenta99d1658a55f818a7e136d48d44d893406eae3e1
Rtstool sets wrong exception message on save

Rtstool does not properly set the message on the RtstoolError exception
on the save_to_file method (save operation) because it's passing
formatting arguments as if it were a LOG call instead of formatting
those same arguments with
%.

There are 2 cases where this can happen, when saving to the default
location on a system that has no target.service installed and the
creation of the default directory fails, and when saving the file
actually fails.

This patch properly formats the message before passing it to the
instantiation of RtstoolError exception.

Change-Id: I13492f695dc0a63a616325bcd0893b2f908cf9fe
Closes-Bug: #1547008
cinder/cmd/rtstool.py
cinder/tests/unit/test_cmd.py