Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Rewrite of generate_clients.rb #40

Open
bastelfreak opened this issue Jun 5, 2016 · 1 comment
Open

Rewrite of generate_clients.rb #40

bastelfreak opened this issue Jun 5, 2016 · 1 comment

Comments

@bastelfreak
Copy link
Collaborator

quote from @hunner:


All of the above code is terrible and should be deleted.
This function takes an argument as args but that in handled in the second block below... What is this block doing then? It calls to_hash seemingly out of no where, and that takes the catalog's scope and turns it into a hash, supposedly to look for variables "at top scope" that come from some data source (like the old puppet enterprise console) but it has no safety and will pick up ANY variables in the namespace, including facts. This is a terrible design and seriously bad side-effects.
I mean, this function says "okay, I was called with args but before using that I'm just going to see if I can find anything else that could possibly have been passed to me but wasn't" and then tries to execute it.
Also, the raises in the begin just get captured by the rescue block that then raises again with the same message. Wat.


based on a discussion in voxpupuli/puppet-bacula#37 (comment)

@dhoppe
Copy link
Contributor

dhoppe commented Sep 16, 2016

The function generate_clients does not use the parameter clients from manifests/director.pp. Somehow it uses the fact bacula_client_package from spec/classes/bacula_spec.rb.

I have no idea why the Rspec tests contain these facts, since the module does not provide any of them. Maybe it is time to ask @ccaum how this worked in the first place.

Even if I exclude backup_client_package at lib/puppet/parser/functions/generate_clients.rb and configure a hash of clients, there are several errors regarding db_backend at manifests/director.pp.

I think this module need to be rewritten completely.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants