def wait(self, timeout=900, check_interval_secs=5):
        """Waits for a deployment to finish

        If a deployment completes successfully, True is returned, if it fails
        for any reason a DeploymentFailed exception is raised. If the
        deployment does not complete within ``timeout`` seconds, a
        DeploymentFailed exception is raised.

        ``check_interval_secs`` is used to determine the delay between
        subsequent checks. The default of 5 seconds is adequate for normal
        use.
        """
        _started = datetime.datetime.utcnow()

        while True:

            time.sleep(check_interval_secs)

            # check if the deployment has completed, if it has we return True
            if self.check():
                return True

            # if the specified timeout has elapsed we raise a DeploymentFailed error
            delta = datetime.datetime.utcnow() - _started
            if delta.total_seconds() > timeout:
                raise DeploymentFailed('Timed out: %d seconds' % timeout)
dataset/ETHPy150Open shopkeep/shpkpr/shpkpr/marathon/deployment.py/MarathonDeployment.wait/original