'Get common kwargs for calling Stack() for cloning.
The point of this method is to reduce the number of places that we
need to update when a kwarg to Stack.__init__() is modified. It
is otherwise easy to forget an option and cause some unexpected
error if this option is lost.
Note:
- This doesn\'t return the args(name, template) but only the kwargs.
- We often want to start \'fresh\' so don\'t want to maintain the old
status, action and status_reason.
- We sometimes only want the DB attributes.'

def get_kwargs_for_cloning(self, keep_status=False, only_db=False):

    stack = {'owner_id': self.owner_id, 'username': self.username, 'disable_rollback': self.disable_rollback, 'stack_user_project_id': self.stack_user_project_id, 'user_creds_id': self.user_creds_id, 'nested_depth': self.nested_depth, 'convergence': self.convergence, 'current_traversal': self.current_traversal, 'prev_raw_template_id': self.prev_raw_template_id, 'current_deps': self.current_deps}
    if keep_status:
        stack.update({'action': self.action, 'status': self.status, 'status_reason': six.text_type(self.status_reason)})
    if only_db:
        stack['parent_resource_name'] = self.parent_resource_name
        stack['tenant'] = self.tenant_id
        stack['timeout'] = self.timeout_mins
    else:
        stack['parent_resource'] = self.parent_resource_name
        stack['tenant_id'] = self.tenant_id
        stack['timeout_mins'] = self.timeout_mins
        stack['strict_validate'] = self.strict_validate
    return stack
