@bottle.route(url_base + '/<tenant_id>/instances/<instance_id>/action', method='POST')
def http_post_instance_scenario_action(tenant_id, instance_id):
    '''take an action over a scenario instance'''
    #check valid tenant_id
    if not nfvo.check_tenant(mydb, tenant_id): 
        print 'httpserver.http_post_instance_scenario_action() tenant %s not found' % tenant_id
        bottle.abort(HTTP_Not_Found, tenant_id % 'Tenant %s not found')
        return
    #parse input data
    http_content,_ = format_in( instance_scenario_action_schema )
    r = af.remove_extra_items(http_content, instance_scenario_action_schema)
    if r is not None: print "http_post_instance_scenario_action: Warning: remove extra items ", r
    print "http_post_instance_scenario_action input: ", http_content
    #obtain data
    result, data = mydb.get_instance_scenario(instance_id, tenant_id)
    if result < 0:
        print "http_get_instance_id error %d %s" % (-result, data)
        bottle.abort(-result, data)
    instance_id = data["uuid"]
    
    result, data = nfvo.instance_action(mydb, tenant_id, instance_id, http_content)
    if result < 0:
        print "http_post_scenario_action error %d: %s" % (-result, data)
        bottle.abort(-result, data)
    else:
        return format_out(data)
dataset/ETHPy150Open nfvlabs/openmano/openmano/httpserver.py/http_post_instance_scenario_action/swapped operands of `%`