Merge "Make backup stack naming more consistent"

This commit is contained in:
Jenkins 2016-03-14 12:59:37 +00:00 committed by Gerrit Code Review
commit c25da60361
1 changed files with 3 additions and 2 deletions

View File

@ -561,7 +561,7 @@ class Stack(collections.Mapping):
If self.id is set, we update the existing stack.
"""
s = self.get_kwargs_for_cloning(keep_status=True, only_db=True)
s['name'] = self._backup_name() if backup else self.name
s['name'] = self.name
s['backup'] = backup
s['updated_at'] = self.updated_time
if self.t.id is None:
@ -1073,7 +1073,8 @@ class Stack(collections.Mapping):
kwargs = self.get_kwargs_for_cloning()
kwargs['owner_id'] = self.id
del(kwargs['prev_raw_template_id'])
prev = type(self)(self.context, self.name, copy.deepcopy(self.t),
prev = type(self)(self.context, self._backup_name(),
copy.deepcopy(self.t),
**kwargs)
prev.store(backup=True)
LOG.debug('Created new backup stack')