Skip to content

Add org scoping to lifecycle_environments variable#1980

Open
tyderian1978 wants to merge 2 commits into
theforeman:developfrom
tyderian1978:scope_lifecycle_environments
Open

Add org scoping to lifecycle_environments variable#1980
tyderian1978 wants to merge 2 commits into
theforeman:developfrom
tyderian1978:scope_lifecycle_environments

Conversation

@tyderian1978

Copy link
Copy Markdown

This fixes the Found too many (3) results while searching for lifecycle_environments with name="Library" error message seen when specifing lifecycle_environments for both the content_view and smart_proxy modules.

This related to 1463 theforeman.foreman.smart_proxy lifecycle_environments not working with duplicate LCEs names.

Comment thread plugins/modules/smart_proxy.py Outdated
name=dict(required=True),
url=dict(required=True),
lifecycle_environments=dict(required=False, type='entity_list'),
lifecycle_environments=dict(required=False, type='entity_list', scope=['organization']),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this work given the smart proxy module gets a list of organizations, not a single one?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi @evgeni the lifecycle_environments variable is a list in all of its invocations (content_view, content_view_version and smart_proxy modules). I have tested against the content_view module with both a single string "Library" and also a list with multiple items and can confirm it works ok.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So whu are tests failing with
[ERROR]: Task failed: Module failed: Failed to lookup scope ['organization'] while searching for lifecycle_environments.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Hi evgeni, I've fixed the unit tests for content_view.
The fix for smart_proxy is more involved, so I thought it best to separate the fixes. It looks like the remaining failing tests are not related to the changes I have made.

@tyderian1978 tyderian1978 force-pushed the scope_lifecycle_environments branch from 9e2895c to bbc8bb6 Compare July 3, 2026 01:30
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