Skip to content

weird issue with the proxy settings if 'proxy_server' seems to be set not fully correct #506

@merclangrat

Description

@merclangrat

We use archive module in our setup and we found a weird issue: puppet was failing with the error
Error: Failed to apply catalog: undefined method `to_sym' for nil:NilClass
in the following line

self[:proxy_type] ||= URI(self[:proxy_server]).scheme.to_sym

That looked weird. On some our servers we have proxy but on other ones we don't, there proxy_server was set to undef, but, as I understand, Ruby considered that it's not empty and tried to use URI.scheme (which returned "nil" and then failed)

I tried different approaches and had to hack the code to make it working, checking not self[:proxy_server] in Line 277 but URI(self[:proxy_server]).scheme

Can you please have a look into this issue? I am not familiar with Ruby and that was the easiest approach I could find.
Maybe, if proxy_server is not empty but doesn't have a scheme (e.g. proxy.example.com:3128, not http://proxy.example.com:3128, the module would consider http as a default scheme?

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