diff options
author | Marco Capitani <[email protected]> | 2017-04-28 12:10:00 +0200 |
---|---|---|
committer | Marco Capitani <[email protected]> | 2017-04-28 12:10:00 +0200 |
commit | 3081d070cda223afd548645143142e1104b07d83 (patch) | |
tree | 2f0c529a1496a47f7cea133f598b13dbb7f1e339 /examples | |
parent | 200e920ec04164ed3d96f034082efd9464287f7a (diff) | |
download | rumba-3081d070cda223afd548645143142e1104b07d83.tar.gz rumba-3081d070cda223afd548645143142e1104b07d83.zip |
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])
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/example.py | 9 |
1 files changed, 5 insertions, 4 deletions
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], |