This repository was archived by the owner on Apr 1, 2025. It is now read-only.
Open
Conversation
PierreHachard
suggested changes
Jul 11, 2022
| dict_asset_groups = {} | ||
| for node_asset in node_assets: | ||
| groups = [] | ||
| if node_asset.groups: |
Collaborator
There was a problem hiding this comment.
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 |
Collaborator
There was a problem hiding this comment.
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) |
Collaborator
There was a problem hiding this comment.
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
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.