|
12 | 12 | pulp_command, |
13 | 13 | ) |
14 | 14 |
|
15 | | -from pulp_glue.common.context import DATETIME_FORMATS |
| 15 | +from pulp_glue.common.context import DATETIME_FORMATS, PulpEntityContext |
16 | 16 | from pulp_glue.common.i18n import get_translation |
17 | 17 | from pulp_glue.workflow.context import PulpWorkflowContext |
18 | 18 |
|
|
51 | 51 | @pass_pulp_context |
52 | 52 | def create( |
53 | 53 | pulp_ctx: PulpCLIContext, |
54 | | - entity_ctx: PulpWorkflowContext, |
| 54 | + entity_ctx: PulpEntityContext, |
55 | 55 | /, |
56 | 56 | name: str, |
57 | 57 | start_time: t.Optional[datetime], |
58 | 58 | tasks: tuple[str, ...], |
59 | 59 | pulp_labels: tuple[str, ...], |
60 | 60 | ) -> None: |
61 | 61 | """Create a workflow.""" |
| 62 | + assert isinstance(entity_ctx, PulpWorkflowContext) |
| 63 | + |
62 | 64 | body: dict[str, t.Any] = {"name": name} |
63 | 65 |
|
64 | 66 | if start_time is not None: |
@@ -95,10 +97,12 @@ def create( |
95 | 97 | @pass_pulp_context |
96 | 98 | def cancel( |
97 | 99 | pulp_ctx: PulpCLIContext, |
98 | | - entity_ctx: PulpWorkflowContext, |
| 100 | + entity_ctx: PulpEntityContext, |
99 | 101 | /, |
100 | 102 | ) -> None: |
101 | 103 | """Cancel a waiting or running workflow.""" |
| 104 | + assert isinstance(entity_ctx, PulpWorkflowContext) |
| 105 | + |
102 | 106 | entity = entity_ctx.entity |
103 | 107 | if entity["state"] not in ("waiting", "running"): |
104 | 108 | raise click.ClickException( |
|
0 commit comments