- raise ValueError("Unknown network layer {0}. "
- "Valid options are: "
- "L2, L3_IP4, L3_IP6, L4.".format(layer))
+ try:
+ data = {
+ "access-lists": {
+ "acl": [
+ {
+ "type": "ietf-access-control-list:{0}-acl"
+ .format(layers[layer]['suffix']),
+ "name": list_name
+ }
+ ],
+ "default-action": default_action,
+ "mode": layers[layer]['mode']
+ }
+ }
+ except KeyError:
+ raise ValueError("Unknown network layer {0}. "
+ "Valid options are: {1}".format(
+ layer, layers.keys()))