Пример #1
0
 def deserialize(cls, serialized: Mapping[str,
                                          Any]) -> "SNMPPluginStoreItem":
     return cls(
         [BackendSNMPTree.from_json(tree) for tree in serialized["trees"]],
         SNMPDetectSpec.from_json(serialized["detect_spec"]),
         serialized["inventory"],
     )
Пример #2
0
 def deserialize(cls, serialized: Dict[str, Any]) -> "SNMPPluginStoreItem":
     try:
         return cls(
             [BackendSNMPTree.from_json(tree) for tree in serialized["trees"]],
             SNMPDetectSpec.from_json(serialized["detect_spec"]),
             serialized["inventory"],
         )
     except (LookupError, TypeError, ValueError) as exc:
         raise ValueError(serialized) from exc