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

Allow inventory as a directory by using project_dir from Obsah #237

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Apr 3, 2020

No description provided.

@ehelms
Copy link
Member Author

ehelms commented Apr 3, 2020

Requires theforeman/obsah#3

The idea is to allow breaking up big package manifests into smaller files inside a directory.

Comment on lines +63 to +68
inventory = os.path.join(os.getcwd(), 'package_manifest.yaml')

if os.path.isdir('package_manifests'):
inventory = os.path.join(os.getcwd(), 'package_manifests')

return os.environ.get('OBAL_INVENTORY', inventory)
Copy link
Member

@ekohl ekohl Apr 3, 2020

Choose a reason for hiding this comment

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

Would this be clearer?

Suggested change
inventory = os.path.join(os.getcwd(), 'package_manifest.yaml')
if os.path.isdir('package_manifests'):
inventory = os.path.join(os.getcwd(), 'package_manifests')
return os.environ.get('OBAL_INVENTORY', inventory)
try:
return os.environ['OBAL_INVENTORY']
except KeyError:
if os.path.isdir('package_manifests'):
return os.path.join(os.getcwd(), 'package_manifests')
else:
return os.path.join(os.getcwd(), 'package_manifest.yaml')

Edit: what always bugged me was package_manifest and packages with tab completion. Should we follow Ansible and use inventory/ or inventory.yaml

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