Skip to content

Commit

Permalink
include_role in to_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
haidaraM committed Jul 17, 2024
1 parent 9b61a54 commit 3937c66
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ansibleplaybookgrapher/graph_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def to_dict(self, exclude_compositions: bool = False, **kwargs) -> Dict:
node only.
:return:
"""
node_dict: Dict = super().to_dict(**kwargs)
node_dict = super().to_dict(**kwargs)

if not exclude_compositions:
for composition, nodes in self._compositions.items():
Expand Down Expand Up @@ -630,3 +630,17 @@ def has_loop(self) -> bool:
return False

return super().has_loop()

def to_dict(self, exclude_compositions: bool = False, **kwargs) -> Dict:
"""
Return a dictionary representation of this composite node. This representation is not meant to get the
original object back.
:param exclude_compositions: Whether to exclude the compositions from the dict or not. Applied to the current
node only.
:param kwargs:
:return:
"""
node_dict = super().to_dict(**kwargs)
node_dict["include_role"] = self.include_role

return node_dict

0 comments on commit 3937c66

Please sign in to comment.