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

Fixes #7442: License file is not generated any more #971

Conversation

fanf
Copy link
Member

@fanf fanf commented Nov 23, 2015

https://www.rudder-project.org/redmine/issues/7442

Alternative to #970 with some refactoring so that:

  • licences are read only ONE time by generation process, and actually one (with the current implementation, they are not, since the getalllicences methods wasn't called at the begining of the generation process)
  • all dead code regarding licenses and licenses repository is removed

Summary: we are getting all the licenses info at the begining of the generation process, and give that map of (nodeId, licenses) to systemVariableService and promiseWritter so they can use it directly without re-reading XML and with consistent data all along generation process.

@fanf fanf force-pushed the bug_7442/license_file_is_not_generated_any_more branch from 24b979a to 1a05294 Compare November 23, 2015 20:48
logger.debug("Loading License")
val license = NovaLicense.parseXml(elt)
licenseMap.put(license.uuid, license)
private[this] def loadLicenses(): Box[Unit] = {
Copy link
Member

Choose a reason for hiding this comment

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

Why not returning the map here and get rid of the mutable var which saddens me :(

Copy link
Member

Choose a reason for hiding this comment

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

i indeed fail to see the benefit of the map, a def returning the result would do the same, especially since we are now loading the licences at each generation

@fanf fanf force-pushed the bug_7442/license_file_is_not_generated_any_more branch from 1a05294 to f554b0d Compare November 23, 2015 21:15
VinceMacBuche added a commit that referenced this pull request Nov 23, 2015
…ted_any_more

Fixes #7442: License file is not generated any more
@VinceMacBuche VinceMacBuche merged commit 23e0bde into Normation:branches/rudder/3.2 Nov 23, 2015
@fanf fanf deleted the bug_7442/license_file_is_not_generated_any_more branch March 15, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants