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

Rewrite of generate_clients.rb #40

@bastelfreak

Description

@bastelfreak

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions