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

Adjust extra_data path relative to the play path #14

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

abbra
Copy link
Collaborator

@abbra abbra commented Feb 6, 2025

We assume users specify extra_data content relative to the directory in which the target topology definition is located. Previously, extra_data relied on the current work directory of the ipalab-config tool which might be different, especially in github actions.

@abbra abbra force-pushed the adjust-extra_data-path branch from f098dc7 to 857929b Compare February 6, 2025 18:53
@rjeffman
Copy link
Owner

rjeffman commented Feb 6, 2025

Curiously, I was looking at this issue right now.

There's still an issue with someone adding a path above the config directory, as ../somedir/something_else.

@abbra
Copy link
Collaborator Author

abbra commented Feb 6, 2025

two choices:

  • document that extra_data is relative to the playbook file
  • check that extra_data paths aren't absolute and only then normalize them to the absolute ones

@rjeffman
Copy link
Owner

rjeffman commented Feb 6, 2025

Yes, and I'm leaning to the first option (as I also need to add individual files to extra_data, not only directories).

@abbra abbra force-pushed the adjust-extra_data-path branch from 857929b to 56950fc Compare February 6, 2025 21:03
extra_data can be either relative or absolute.

We assume users specify extra_data content relative to the directory in
which the target topology definition is located. Previously, extra_data
relied on the current work directory of the ipalab-config tool which
might be different, especially in github actions.

Signed-off-by: Alexander Bokovoy <[email protected]>
@abbra abbra force-pushed the adjust-extra_data-path branch from 56950fc to 3c29bbc Compare February 6, 2025 21:06
@abbra
Copy link
Collaborator Author

abbra commented Feb 6, 2025

I added handling for both. Basically, if file/directory is absolute, use its dirname as a source. if it is relative, use the args.CONFIG dirname.

Copy link
Owner

@rjeffman rjeffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@rjeffman rjeffman merged commit c3562a0 into rjeffman:main Feb 7, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants