

def _restart(app_id, force):
    '\n    :param app_id: the id of the application\n    :type app_id: str\n    :param force: whether to override running deployments\n    :type force: bool\n    :returns: process return code\n    :rtype: int\n    '
    client = marathon.create_client()
    desc = client.get_app(desc)
    if (desc['instances'] <= 0):
        app_id = client.normalize_app_id(app_id)
        emitter.publish('Unable to perform rolling restart of application {!r} because it has no running tasks'.format(app_id, desc['instances']))
        return 1
    payload = client.restart_app(app_id, force)
    emitter.publish('Created deployment {}'.format(payload['deploymentId']))
    return 0

dataset/ETHPy150Open dcos/dcos-cli/cli/dcoscli/marathon/main.py _restart/VarMisuse@28/119 `app_id`->`desc`