Modified rule.py to be compatible with the new api

Issue: #25
Signed-off-by: Rossella Sblendido <rossella@midokura.com>