'Adopt existing resources into a new stack.'

@profiler.trace('Stack.adopt', hide_args=False)
@reset_state_on_error
def adopt(self):

    def rollback():
        if ((not self.disable_rollback) and (self.state == (self.ADOPT, self.FAILED))):
            for res in six.itervalues(self.resources):
                res.abandon_in_progress = True
            self.delete(action=self.ROLLBACK, abandon=True)
    creator = scheduler.TaskRunner(self.stack_task, action=self.ADOPT, reverse=False, post_func=rollback)
    creator(timeout=self.timeout_secs())
