Renaming backup_id param

Change-Id: Ice5cb9a214f2f8d8e51853c4c2d0201cb14ea6ba
This commit is contained in:
Steve Leon
2013-04-12 01:03:21 -07:00
parent daba7cba30
commit 0f4c1f7ba3
2 changed files with 8 additions and 5 deletions

View File

@@ -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)

View File

@@ -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):