from src.config import DEV_ENVIRONMENT OWS_ASSETS = "ows-assets" OWS_ASSETS_GET_IMAGE_LOCATION = "/image/product/{cover_type}/{product_id}/location" OWS_ASSETS_GET_IMAGE_LOCATIONS = "/image/product/{cover_type}/location?fallback=1" def get_service_url(environment, service_name, path): """Return the service url based on environment.""" service_url = "https://{environment}-{service_name}.theorchard.io{path}" if environment == DEV_ENVIRONMENT: service_url = "https://{environment}-{service_name}.dev.theorchard.io{path}" # noqa return service_url.format( environment=environment, service_name=service_name, path=path )