Clean up bare raised pylint warning

Clean up bare raises warning by linter, pylint
complains about raising an exception specified
and not in the context of an exception handler.
Added an exception.

Change-Id: I1d77c6ab9849510c45fdd99dd57b71bde9a57da6
Signed-off-by: Chuck Short <chucks@redhat.com>
This commit is contained in:
Chuck Short 2018-09-10 17:07:57 -04:00
parent 0154b8dd7a
commit 39defc040b
3 changed files with 2 additions and 3 deletions

View File

@ -80,7 +80,6 @@ disable=
keyword-arg-before-vararg,
too-many-function-args,
unsupported-assignment-operation,
misplaced-bare-raise,
not-an-iterable,
unsupported-membership-test,
unsupported-assignment-operation,

View File

@ -2374,7 +2374,7 @@ class RestClient(object):
result = self.call(url, None, "GET", log_filter_flag=True)
if result['error']['code'] != 0:
raise
raise Exception(_('Failed to get object count.'))
if result.get("data"):
return result.get("data").get("COUNT")

View File

@ -348,7 +348,7 @@ class NaElement(object):
if isinstance(na_element, NaElement):
self._element.append(na_element._element)
return
raise
raise Exception(_('Failed to add child element.'))
def get_child_by_name(self, name):
"""Get the child element by the tag name."""