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

(GH-311) Explicitly require Facter #312

Merged
merged 2 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Directories
# environment, create a new Puppet::Node::Environment object for the workspace
alias_method :original_get, :get
def get(name)
if name == PuppetLanguageServerSidecar::PuppetHelper::SIDECAR_PUPPET_ENVIRONMENT
if name.intern == PuppetLanguageServerSidecar::PuppetHelper::SIDECAR_PUPPET_ENVIRONMENT.intern
env_symbol = name.intern
setting_values = Puppet.settings.values(env_symbol, Puppet.settings.preferred_run_mode)
env = Puppet::Node::Environment.create(
Expand All @@ -26,7 +26,7 @@ def get(name)
# from the workspace.
alias_method :original_get_conf, :get_conf
def get_conf(name)
if name == PuppetLanguageServerSidecar::PuppetHelper::SIDECAR_PUPPET_ENVIRONMENT.intern
if name.intern == PuppetLanguageServerSidecar::PuppetHelper::SIDECAR_PUPPET_ENVIRONMENT.intern
conf = Puppet::Settings::EnvironmentConf.load_from(PuppetLanguageServerSidecar::Workspace.root_path, @global_module_path)
# Unfortunately the environment.conf expects OS style delimiters which means
# it fails if written for windows and read on Unix and vice versa. So we just
Expand Down
1 change: 1 addition & 0 deletions lib/puppet_languageserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def self.require_gems(options)
begin
require 'lsp/lsp'
require 'puppet'
require 'facter'
rescue LoadError => e
log_message(:error, "Error while loading a critical gem: #{e} #{e.backtrace}")
return
Expand Down