| 15 | |
| 16 | |
| 17 | class RebuildTask: |
| 18 | def __init__(self, full_rebuild = False) -> None: |
| 19 | self._full_rebuild = full_rebuild |
| 20 | self._agents: Optional[Set[str]] = None |
| 21 | self._policies: Optional[Set[str]] = None |
| 22 | self._collections: Optional[Set[str]] = None |
| 23 | self._approvals: Optional[Set[str]] = None |
| 24 | |
| 25 | @property |
| 26 | def full_rebuild(self) -> bool: |
| 27 | return self._full_rebuild |
| 28 | |
| 29 | def add_agents(self, agents: Iterable[str]) -> None: |
| 30 | if self._full_rebuild: |
| 31 | return |
| 32 | if self._agents is None: |
| 33 | self._agents = set() |
| 34 | self._agents.update(agents) |
| 35 | |
| 36 | def add_policies(self, policies: Iterable[str]) -> None: |
| 37 | if self._full_rebuild: |
| 38 | return |
| 39 | if self._policies is None: |
| 40 | self._policies = set() |
| 41 | self._policies.update(policies) |
| 42 | |
| 43 | def add_collections(self, collections: Iterable[str]) -> None: |
| 44 | if self._full_rebuild: |
| 45 | return |
| 46 | if self._collections is None: |
| 47 | self._collections = set() |
| 48 | self._collections.update(collections) |
| 49 | |
| 50 | def add_approvals(self, approvals: Iterable[str]) -> None: |
| 51 | if self._full_rebuild: |
| 52 | return |
| 53 | if self._approvals is None: |
| 54 | self._approvals = set() |
| 55 | self._approvals.update(approvals) |
| 56 | |
| 57 | @property |
| 58 | def agents(self) -> Optional[Iterable[str]]: |
| 59 | return self._agents |
| 60 | |
| 61 | @property |
| 62 | def policies(self) -> Optional[Iterable[str]]: |
| 63 | return self._policies |
| 64 | |
| 65 | @property |
| 66 | def collections(self) -> Optional[Iterable[str]]: |
| 67 | return self._collections |
| 68 | |
| 69 | @property |
| 70 | def approvals(self) -> Optional[Iterable[str]]: |
| 71 | return self._approvals |
| 72 | |
| 73 | |
| 74 | class IPedmAdmin(abc.ABC): |