def get_last_install(client, deployment_id):
    """ Gets the execution and status of the last install
        for the supplied deployment
    """

    executions = client.executions.list(deployment_id=deployment_id)

    execution = None
    for e in executions:
        if e.workflow_id == "install":
            execution = e

    if not execution:
        return None, None  # no install found

    if execution.status in ["started", "pending"]:
        return execution.id, "started"
    else:
        return execution.id, execution.status