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

Aggregate Mode - group synchronization #276

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

Conversation

amel-kcl
Copy link
Collaborator

No description provided.

dict_asset_groups = {}
for node_asset in node_assets:
groups = []
if node_asset.groups:
Copy link
Collaborator

Choose a reason for hiding this comment

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

We must check at some point that we do not have assets without hostname

Maybe add node_asset.hostname is not None to this condition

Or get rid of assets with no hostname directly from the "local_assets" list

PARAMS = { "groups": groups_to_add}
client_aggregate.update_server(str(aggregate_assets_by_hostname_id[asset]),PARAMS)

# Add missing groups to assets on aggregation node - assets without groups without groups case
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# Add missing groups to assets on aggregation node - assets without groups without groups case
# Add missing groups to assets on aggregation node - assets without groups case

for group in dict_asset_groups_local[asset]:
groups_to_add.append(aggregate_groups[group])
PARAMS = { "groups": groups_to_add}
client_aggregate.update_server(str(aggregate_assets_by_hostname_id[asset]),PARAMS)
Copy link
Collaborator

Choose a reason for hiding this comment

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

After further testing, it is not enough to check that the assets hostname are not None

The script also throws an exception when the hostname is an IP adresse for example.

The str() function probably does not handle this cases well

@PierreHachard
Copy link
Collaborator

Can we add a function, that is not necessarily ran by default, add a group that matches the name of the agregated node on assets on the agregation node

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