Fix for bug 931712. Make keypair test work.

Throw exception for 409.
Eliminate test for fetching key becuase there is no such API.
Eliminate negative test for empty public key because (spec?) the nova code doesn't care.
Change tests that were checking for 4xx responses to catch the thrown exceptions.

Change-Id: I3e880f888ec2534d87d035cea722fad4a5987444

Fix test_server_actions.

conf_from_devstack needs to set image_ref_alt
Add throw for all unlisted 4xx cases in rest_client

Change-Id: Ie511bfd28bda2e21e1ada7f3cbcd43304279ba67
diff --git a/tempest/common/rest_client.py b/tempest/common/rest_client.py
index 119494d..754a1f6 100644
--- a/tempest/common/rest_client.py
+++ b/tempest/common/rest_client.py
@@ -128,6 +128,11 @@
             self._log(req_url, body, resp, resp_body)
             raise exceptions.BadRequest(resp_body['badRequest']['message'])
 
+        if resp.status == 409:
+            resp_body = json.loads(resp_body)
+            self._log(req_url, body, resp, resp_body)
+            raise exceptions.Duplicate(resp_body)
+
         if resp.status == 413:
             resp_body = json.loads(resp_body)
             self._log(req_url, body, resp, resp_body)
@@ -150,4 +155,9 @@
                 message = resp_body['computeFault']['message']
             raise exceptions.ComputeFault(message)
 
+        if resp.status >= 400:
+            resp_body = json.loads(resp_body)
+            self._log(req_url, body, resp, resp_body)
+            raise exceptions.TempestException(str(resp.status))
+
         return resp, resp_body