def __log_status(task_id, status_name, status_code):
    status_stat = "Failed"
    if (type(status_code)==int and 199<status_code<300) or (type(status_code)==bool and status_code):
        logger.debug("Status code type is %s and value is %s :" % (str(type(status_code)), str(status_code)))
        status_stat = "OK"

    update_task_status(task_id, status_name, status_stat)
def __do_setup(task_id, deployment_id, params):
    create_task(task_id)
    logger.info("Start to setup VNX backend for OpenStack %s" % deployment_id)
    result, status_code = process_controller(
        "/openstack/deployments/%s/storage/vnx" % deployment_id, "post", pay_load=json.dumps({"parameters": params})
    )
    if status_code > 200:
        update_task_status(task_id, "result", "failed")
    else:
        update_task_status(task_id, "result", "OK")