Skip to content

Commit 96f811b

Browse files
committed
(PUP-9319) Use remote environment for puppet device
This commit uses a "remote" environment, instead of a full one. This allows the override to work, even if we do not have that environment's codedir available locally. In the case of a full puppet run, the `Configurer` does additional work to update and sync the plugindir vs what the ENC specifies.
1 parent 3693ffc commit 96f811b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/puppet/application/device.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def main
228228
confdir = Puppet[:confdir]
229229
certname = Puppet[:certname]
230230

231-
env = Puppet.lookup(:environments).get(Puppet[:environment])
231+
env = Puppet::Node::Environment.remote(Puppet[:environment])
232232
returns = Puppet.override(:current_environment => env, :loaders => Puppet::Pops::Loaders.new(env)) do
233233
# find device list
234234
require 'puppet/util/network_device/config'
@@ -257,7 +257,7 @@ def main
257257
Puppet[:vardir] = ::File.join(Puppet[:devicedir], device.name)
258258
Puppet[:certname] = device.name
259259

260-
Puppet::Configurer::PluginHandler.new.download_plugins(env)
260+
Puppet::Configurer::PluginHandler.new.download_plugins(Puppet::Node::Environment.remote(Puppet[:environment]))
261261
# this init the device singleton, so that the facts terminus
262262
# and the various network_device provider can use it
263263
Puppet::Util::NetworkDevice.init(device)

0 commit comments

Comments
 (0)