from .events import Event
+class InfrastructureInventoryObject:
+ ObjectState = {}
+
+ def __init__(self) -> None:
+ # self.ObjectState = {}
+ pass
+
+ def get_fields_as_dict(self, fields):
+ for field in fields:
+ if hasattr(self, field):
+ self.ObjectState[field] = getattr(self, field)
+ return self.ObjectState
+
+
class AgRoot:
events = []
def serialize(self):
try:
- # d = {c: getattr(self, c) for c in inspect(self).attrs.keys()}
+ d = {c: getattr(self, c) for c in inspect(self).attrs.keys()}
# if 'createtime' in d:
# d['createtime'] = d['createtime'].isoformat()
# if 'updatetime' in d:
# d['updatetime'] = d['updatetime'].isoformat()
- # return d
- return {c: getattr(self, c) for c in inspect(self).attrs.keys()}
+ return d
+ # return {c: getattr(self, c) for c in inspect(self).attrs.keys()}
except NoInspectionAvailable:
return self.__dict__