'Update the nested stack with the new template.'

def update_with_template(self, child_template, user_params=None, timeout_mins=None):

    if (self.id is None):
        self.store()
    if (self.stack.action == self.stack.ROLLBACK):
        if self._try_rollback():
            LOG.info('Triggered    nested    stack    %s    rollback', self.physical_resource_name())
            return {'target_action': self.stack.ROLLBACK}
    if (self.resource_id is None):
        def _check_for_completion():
            while (not self.check_create_complete()):
                (yield)
        empty_temp = template_format.parse("heat_template_version:    '2013-05-23'")
        self.create_with_template(empty_temp, {})
        checker = scheduler.TaskRunner(_check_for_completion)
        checker(timeout=self.stack.timeout_secs())
    if (timeout_mins is None):
        timeout_mins = self.stack.timeout_mins
    try:
        status_data = stack_object.Stack.get_status(self.context, self.resource_id)
    except exception.NotFound:
        raise resource.UpdateReplace(self)
    (action, status, status_reason, updated_time) = status_data
    kwargs = self._stack_kwargs(user_params, child_template)
    cookie = {'previous': {'updated_at': updated_time, 'state': (action, status)}}
    kwargs.update({'stack_identity': dict(self.nested_identifier()), 'args': {rpc_api.PARAM_TIMEOUT: timeout_mins}})
    with self.translate_remote_exceptions:
        try:
            self.rpc_client()._update_stack(self.context, **kwargs)
        except exception.HeatException:
            with excutils.save_and_reraise_exception():
                raw_template.RawTemplate.delete(self.context, kwargs['template_id'])
    return cookie
