# Path: shpkpr/marathon/deployment.py
# class DeploymentNotFound(exceptions.ShpkprException):
#     pass
# 
# Path: shpkpr/marathon/deployment.py
# class MarathonDeployment(object):
#     """Marathon deployment object.
# 
#     Allows the caller to check a deployment's status and cancel or rollback a
#     deployment.
#     """
# 
#     def __init__(self, client, deployment_id):
#         self._client = client
#         self.deployment_id = deployment_id
# 
#     def check(self):
#         """Check if this deployment has completed.
# 
#         This method returns a True when a deployment is complete, False when a
#         deployment is in progress.
#         """
#         try:
#             self._client.get_deployment(self.deployment_id)
#         except DeploymentNotFound:
#             # if the deployment isn't listed, then we can consider the deployment as completed
#             # successfully and return True. According to the marathon docs: "If the deployment
#             # is gone from the list of deployments, then this means it is finished."
#             return True
# 
#         return False
# 
#     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)
# 
# Path: shpkpr/exceptions.py
# class ShpkprException(ClickException):
# def _args_from_exception(exception):
# def rewrap(exceptions_to_catch, exception_to_rewrap_with=ShpkprException):
#     def real_decorator(function):
#         def wrapper(*args, **kwargs):


import requests
from .deployment import DeploymentNotFound
from .deployment import MarathonDeployment
from shpkpr import exceptions
"""A collection of marathon-related utils
"""
# future imports
from __future__ import absolute_import

# third-party imports

# local imports


class ClientError(exceptions.ShpkprException):
    pass



# Path: shpkpr/marathon/deployment.py
# class DeploymentNotFound(exceptions.ShpkprException):
#     pass
# 
# Path: shpkpr/marathon/deployment.py
# class MarathonDeployment(object):
#     """Marathon deployment object.
# 
#     Allows the caller to check a deployment's status and cancel or rollback a
#     deployment.
#     """
# 
#     def __init__(self, client, deployment_id):
#         self._client = client
#         self.deployment_id = deployment_id
# 
#     def check(self):
#         """Check if this deployment has completed.
# 
#         This method returns a True when a deployment is complete, False when a
#         deployment is in progress.
#         """
#         try:
#             self._client.get_deployment(self.deployment_id)
#         except DeploymentNotFound:
#             # if the deployment isn't listed, then we can consider the deployment as completed
#             # successfully and return True. According to the marathon docs: "If the deployment
#             # is gone from the list of deployments, then this means it is finished."
#             return True
# 
#         return False
# 
#     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)
# 
# Path: shpkpr/exceptions.py
# class ShpkprException(ClickException):
# def _args_from_exception(exception):
# def rewrap(exceptions_to_catch, exception_to_rewrap_with=ShpkprException):
#     def real_decorator(function):
#         def wrapper(*args, **kwargs):


# Path: shpkpr/marathon/client.py
import requests
from .deployment import DeploymentNotFound
from .deployment import MarathonDeployment
from shpkpr import exceptions

"""A collection of marathon-related utils
"""
# future imports
from __future__ import absolute_import

# third-party imports

# local imports


class ClientError(exceptions.ShpkprException):
    pass



class DryRun(exceptions.ShpkprException):