Move CommandFailed exception to tempest.exceptions

When the CommandFailed exception was added it was only being used by
the CLI tests. However, it is generally useful for anything that is
using subprocess to make external calls. This patch moves it to
tempest.exceptions to make using it simpler for non-cli tests to use
the exception.

Change-Id: Ibf5f1cbbb847d32976b54c4484acfc3c0e3b4f48
This commit is contained in:
Matthew Treinish
2014-07-25 18:38:56 -04:00
parent de34db3ee3
commit 4587b91344

View File

@@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from tempest import cli
from tempest import exceptions
from tempest.tests import base
@@ -22,8 +22,8 @@ class TestOutputParser(base.TestCase):
stdout = "output"
stderr = "error"
try:
raise cli.CommandFailed(returncode, cmd, stdout, stderr)
except cli.CommandFailed as e:
raise exceptions.CommandFailed(returncode, cmd, stdout, stderr)
except exceptions.CommandFailed as e:
self.assertIn(str(returncode), str(e))
self.assertIn(cmd, str(e))
self.assertIn(stdout, str(e))