Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable to set task name to mutable content #193

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading