From 3081d070cda223afd548645143142e1104b07d83 Mon Sep 17 00:00:00 2001 From: Marco Capitani Date: Fri, 28 Apr 2017 12:10:00 +0200 Subject: model: added policy class + policy-oriented API fixes + Added policy class + Adapted NormalDIF class to use new policy class + NormalDIF constructor argument policy has changed format (parameters dict is now mandatory, added empty dicts where it was not passed) + Added Node.policies field (type: dict[DIF -> Policy]) --- examples/example.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/example.py b/examples/example.py index 56193c2..c884f3e 100755 --- a/examples/example.py +++ b/examples/example.py @@ -20,16 +20,17 @@ import rumba.log as log log.set_logging_level('DEBUG') -n1 = NormalDIF("n1", policies = {"rmt.pff": "lfa", - "security-manager": "passwd"}) + +n1 = NormalDIF("n1", policies = {"rmt.pff": {"lfa": {}}, + "security-manager": {"passwd": {}}}) e1 = ShimEthDIF("e1") a = Node("a", difs = [n1, e1], dif_registrations = {n1 : [e1]}, - registrations = {"a.crap" : [n1]}, - bindings = {"a.crap" : "/usr/bin/crap"}) + registrations = {"a.thing" : [n1]}, + bindings = {"a.thing" : "/usr/bin/thing"}) b = Node("b", difs = [e1, n1], -- cgit v1.2.3