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

fix filepath issue for yaml string scan #209

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
4 changes: 2 additions & 2 deletions ansible_risk_insight/model_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ def load_playbook(path="", yaml_str="", role_name="", collection_name="", basedi
if fullpath == "":
raise ValueError("file not found")
defined_in = fullpath
if basedir and not yaml_str:
if basedir:
if defined_in.startswith(basedir):
defined_in = defined_in[len(basedir) :]
if defined_in.startswith("/"):
Expand Down Expand Up @@ -1531,7 +1531,7 @@ def load_task(
taskObj.role = role_name
taskObj.collection = collection_name
defined_in = fullpath
if basedir and not yaml_lines:
if basedir:
if defined_in.startswith(basedir):
defined_in = defined_in[len(basedir) :]
if defined_in.startswith("/"):
Expand Down
Loading