From 211542b8a1a8c2516cd9117beaea07ac608e44fa Mon Sep 17 00:00:00 2001 From: Alexandr Notchenko Date: Fri, 16 May 2014 19:03:19 +0400 Subject: [PATCH] Fuel client remove deprecation warning * Modified FuelClientException class * Added Doc-strings to all Fuel-Client exceptions Works. Checked on python 2.6.9 and 2.7.5 Closes-bug: #1320225 Change-Id: I271b8d407ee9c6110d4d86dbb1c06b1a7cf4e761 --- fuelclient/cli/error.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/fuelclient/cli/error.py b/fuelclient/cli/error.py index 6c2c489..b6d385a 100644 --- a/fuelclient/cli/error.py +++ b/fuelclient/cli/error.py @@ -23,27 +23,45 @@ def exit_with_error(message): class FuelClientException(Exception): - pass + """Base Exception for Fuel-Client + + All child classes must be instantiated before raising. + """ + def __init__(self, *args, **kwargs): + super(FuelClientException, self).__init__(*args, **kwargs) + self.message = args[0] class ServerDataException(FuelClientException): - pass + """ServerDataException - must be raised when + data returned from server cannot be processed by Fuel-Client methods. + """ class DeployProgressError(FuelClientException): - pass + """DeployProgressError - must be raised when + deployment process interrupted on server. + """ class ArgumentException(FuelClientException): - pass + """ArgumentException - must be raised when + incorrect arguments inputted through argparse or some function. + """ class ActionException(FuelClientException): - pass + """ActionException - must be raised when + though arguments inputted to action are correct but they contradict + to logic in action. + """ class ParserException(FuelClientException): - pass + """ParserException - must be raised when + some problem occurred in process of argument parsing, + in argparse extension or in Fuel-Client Parser submodule. + """ def handle_exceptions(exc):