diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-04-24 20:54:03 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-04-24 20:54:03 +0000 |
| commit | 85479507fbcb9c4847cf8332d945f675d4f42ef1 (patch) | |
| tree | d370690aaad24b4b877dcd1802e5283c5c559dad | |
| parent | 430661e88dd7ffdb3960a5067640b1f3f29c8e40 (diff) | |
| parent | 0f4c1f7ba346f1f71d0890be4be682899771e48c (diff) | |
| download | python-troveclient-85479507fbcb9c4847cf8332d945f675d4f42ef1.tar.gz | |
Merge "Renaming backup_id param"
| -rw-r--r-- | reddwarfclient/cli.py | 6 | ||||
| -rw-r--r-- | reddwarfclient/client.py | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/reddwarfclient/cli.py b/reddwarfclient/cli.py index 2835b3b..3b71396 100644 --- a/reddwarfclient/cli.py +++ b/reddwarfclient/cli.py @@ -47,7 +47,7 @@ class InstanceCommands(common.AuthedCommandsBase): 'marker', 'name', 'size', - 'backupId' + 'backup' ] def create(self): @@ -55,8 +55,8 @@ class InstanceCommands(common.AuthedCommandsBase): self._require('name', 'size', 'flavor') volume = {"size": self.size} restorePoint = None - if self.backupId is not None: - restorePoint = {"backupId": self.backupId} + if self.backup is not None: + restorePoint = {"backupRef": self.backup} self._pretty_print(self.dbaas.instances.create, self.name, self.flavor, volume, restorePoint=restorePoint) diff --git a/reddwarfclient/client.py b/reddwarfclient/client.py index 61374d0..f602afb 100644 --- a/reddwarfclient/client.py +++ b/reddwarfclient/client.py @@ -38,6 +38,9 @@ _logger = logging.getLogger(__name__) RDC_PP = os.environ.get("RDC_PP", "False") == "True" +expected_errors = (400, 401, 403, 404, 408, 409, 413, 422, 500, 501) + + def log_to_streamhandler(stream=None): stream = stream or sys.stderr ch = logging.StreamHandler(stream) @@ -184,13 +187,13 @@ class ReddwarfHTTPClient(httplib2.Http): else: body = None - if resp.status in (400, 401, 403, 404, 408, 409, 413, 422, 500, 501): + if resp.status in expected_errors: raise exceptions.from_response(resp, body) return resp, body def raise_error_from_status(self, resp, body): - if resp.status in (400, 401, 403, 404, 408, 409, 413, 500, 501): + if resp.status in expected_errors: raise exceptions.from_response(resp, body) def morph_request(self, kwargs): |
