#! /usr/bin/env python

'''
@author: Soizic Laguitton

@organization: I2BM, Neurospin, Gif-sur-Yvette, France
@organization: CATI, France
@organization: U{IFR 49<http://www.ifr49.org>}

@license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}
'''


import sys

from soma.workflow.client import WorkflowController 

if __name__ == '__main__':

    if len(sys.argv) != 3:
        raise Exception("The command takes 2 parameters: \n"
                        "    * the workflow identifier (integer) \n"
                        "    * the computing resource id \n")

    workflow_id = sys.argv[1]

    wfc = WorkflowController(sys.argv[2])

    wfc.stop_workflow(workflow_id)



