Skip to content

Commit

Permalink
enable to set task name to mutable content
Browse files Browse the repository at this point in the history
Signed-off-by: hirokuni-kitahara <[email protected]>
  • Loading branch information
hirokuni-kitahara committed Sep 29, 2023
1 parent 6f47237 commit cb89670
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ansible_risk_insight/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,16 @@ def from_task_spec(task_spec):
)
return mc

def set_task_name(self, task_name: str):
# if `name` is None or empty string, Task.yaml() won't output the field
self._task_spec.name = task_name
self._yaml = self._task_spec.yaml()
self._task_spec.yaml_lines = self._yaml
return self

def get_task_name(self):
return self._task_spec.name

def omit_task_name(self):
# if `name` is None or empty string, Task.yaml() won't output the field
self._task_spec.name = None
Expand Down

0 comments on commit cb89670

Please sign in to comment.