The ideal solution is to break the "definition" argument of validate() [1] into two arguments "definition_contents" and "definition_filename". By doing so, we can avoid double loading of file contents.
On the other hand, this solution is not backward-compatible, so https://review.opendev.org/c/openstack/python-mistralclient/+/800950 proposes a workaround to allow us to pass "definition_contents" explicitly.
This workaround works at least from the prespective of the usage of mistral-dashboard.
Some more detail.
The ideal solution is to break the "definition" argument of validate() [1] into two arguments "definition_ contents" and "definition_ filename" . By doing so, we can avoid double loading of file contents.
On the other hand, this solution is not backward- compatible, so https:/ /review. opendev. org/c/openstack /python- mistralclient/ +/800950 proposes a workaround to allow us to pass "definition_ contents" explicitly.
This workaround works at least from the prespective of the usage of mistral-dashboard.
[1] https:/ /opendev. org/openstack/ python- mistralclient/ src/commit/ 609f4f48a9a740c 56aeae1ce1ba158 1a7f07838d/ mistralclient/ api/v2/ workbooks. py#L98