API tests to check for the return codes

Some API tests were just checking whether a particular request would
raise a generic exception (webtest.app.AppError) or not, and this is not
enough, the API tests should make sure that the request will raise an
exception (expect_errors=True) and also check if the HTTP code returned
is appropriated for that error.

The FIXME left at test_remove_fail() is going to be fixed by a following
patch.

Closes-Bug: #1275812
Change-Id: I156749b3de0627c6d322192c397bbfe33919cf2d
Handle multiple exceptions raised by jsonpatch

The jsonpatch.apply_patch() might raise different types of exceptions,
this patch improve the exception handler on the jsonpatch.apply_patch()
call to capture them and also creates a new exception called PatchError
to avoid replicating the same error message across the resources.

The patch also doesn't log the exception raised by the apply_patch()
anymore, since the problem will be returned to the client directly via
the API response.

In the chassis.py an alias "api_utils" was created to the utils module
to be more consistent with the ports and nodes resource.

Closes-Bug: #1271554
Change-Id: Ied1f5e573839520cc5f4e04548720f016f33349b
Fix 'run_as_root' parameter check in utils

Because 'run_as_root' is boolean parameter we need check it value.

Change-Id: I18876081f98bcafd89e42b1352c933d7ab87d7cc
Merge "API tests to check for the return codes"
Merge "Handle multiple exceptions raised by jsonpatch"
Merge "Fix 'run_as_root' parameter check in utils"