def delete_items():
    global myvim
    global rollback_list
    print "Making rollback, deleting items"
    for i in range(len(rollback_list)-1, -1, -1):
        item,name,id_ = rollback_list[i]
        if item=="creds":
            print ("changing credentials %s='%s'" % (name, id_)).ljust(50),
        else:
            print ("deleting %s '%s'" % (item, name)).ljust(50),
        sys.stdout.flush()
        if item=="flavor":
            result,message=myvim.delete_tenant_flavor(id_)
        elif item=="image":
            result,message=myvim.delete_tenant_image(id_)
        elif item=="tenant":
            result,message=myvim.delete_tenant(id_)
        elif item=="user":
            result,message=myvim.delete_user(id_)
        elif item=="network":
            result,message=myvim.delete_tenant_network(id_)
        elif item=="vm":
            result,message=myvim.delete_tenant_vminstance(id_)
        elif item=="creds":
            try:
                myvim[name]=id_
                result=1
            except Exception, e:
                result=-1
                message= "  " + str(type(e))[6:-1] + ": "+  str(e)
        else:
            print "Internal error unknown item rollback %s,%s,%s" % (item,name,id_)
            continue
        if result<0:
            print " Fail"
            print "  VIM response:", message
            continue
        else:
            print " Ok"
dataset/ETHPy150Open nfvlabs/openmano/openmano/test/test_osconnector.py/delete_items/original