- def geni_fields_to_pl_fields(self, type, hrn, geni_fields, pl_fields):
- if type == "user":
- if not "email" in pl_fields:
- if not "email" in geni_fields:
- raise MissingGeniInfo("email")
- pl_fields["email"] = geni_fields["email"]
-
- if not "first_name" in pl_fields:
- pl_fields["first_name"] = "geni"
-
- if not "last_name" in pl_fields:
- pl_fields["last_name"] = hrn
-
- elif type == "slice":
- if not "instantiation" in pl_fields:
- pl_fields["instantiation"] = "delegated" # "plc-instantiated"
- if not "name" in pl_fields:
- pl_fields["name"] = hrn_to_pl_slicename(hrn)
- if not "max_nodes" in pl_fields:
- pl_fields["max_nodes"] = 10
+ def geni_fields_to_pl_fields(self, type, hrn, record):
+ pl_record = {}
+ for field in record:
+ pl_record[field] = record[field]
+
+ if type == "slice":
+ if not "instantiation" in pl_record:
+ pl_record["instantiation"] = "delegated" # "plc-instantiated"
+ if not "name" in pl_record:
+ pl_record["name"] = hrn_to_pl_slicename(hrn)
+ if not "max_nodes" in pl_record:
+ pl_record["max_nodes"] = 10