Example #1
0
 def load_custom_properties(self):
     filepath = self.config["paths"]["custom_properties"]
     if not filepath:
         custom_properties = {}
     else:
         with open(filepath, "r") as properties:
             custom_properties = yaml.load(properties)
     property_names.update(
         {k: v["pretty_name"]
          for k, v in custom_properties.items()})
     public_custom_properties = {
         k: v
         for k, v in custom_properties.items()
         if not v.get("private", False)
     }
     device_properties.extend(list(custom_properties))
     pool_device_properties.extend(list(public_custom_properties))
     for properties_table in table_properties, filtering_properties:
         properties_table["device"].extend(list(public_custom_properties))
     device_diagram_properties.extend(
         list(p for p, v in custom_properties.items()
              if v["add_to_dashboard"]))
     private_properties.extend(
         list(p for p, v in custom_properties.items()
              if v.get("private", False)))
     return custom_properties
Example #2
0
File: base.py Project: blaisep/eNMS
 def load_custom_properties(self):
     for model, values in self.properties["custom"].items():
         property_names.update({k: v["pretty_name"] for k, v in values.items()})
         model_properties[model].extend(list(values))
         private_properties.extend(
             list(p for p, v in values.items() if v.get("private", False))
         )