|
1 | 1 | require 'puppet/application' |
| 2 | +require 'puppet/configurer' |
2 | 3 | require 'puppet/util/network_device' |
3 | 4 |
|
4 | 5 | class Puppet::Application::Device < Puppet::Application |
@@ -222,6 +223,7 @@ def main |
222 | 223 | raise _("missing argument: --target is required when using --apply") if options[:target].nil? |
223 | 224 | raise _("%{file} does not exist, cannot apply") % { file: options[:apply] } unless File.file?(options[:apply]) |
224 | 225 | end |
| 226 | + libdir = Puppet[:libdir] |
225 | 227 | vardir = Puppet[:vardir] |
226 | 228 | confdir = Puppet[:confdir] |
227 | 229 | certname = Puppet[:certname] |
@@ -251,9 +253,11 @@ def main |
251 | 253 |
|
252 | 254 | # override local $vardir and $certname |
253 | 255 | Puppet[:confdir] = ::File.join(Puppet[:devicedir], device.name) |
| 256 | + Puppet[:libdir] = ::File.join(Puppet[:devicedir], device.name, 'lib') |
254 | 257 | Puppet[:vardir] = ::File.join(Puppet[:devicedir], device.name) |
255 | 258 | Puppet[:certname] = device.name |
256 | 259 |
|
| 260 | + Puppet::Configurer::PluginHandler.new.download_plugins(env) |
257 | 261 | # this init the device singleton, so that the facts terminus |
258 | 262 | # and the various network_device provider can use it |
259 | 263 | Puppet::Util::NetworkDevice.init(device) |
@@ -316,6 +320,7 @@ def main |
316 | 320 | # If we rescued an error, then we return 1 as the exit code |
317 | 321 | 1 |
318 | 322 | ensure |
| 323 | + Puppet[:libdir] = libdir |
319 | 324 | Puppet[:vardir] = vardir |
320 | 325 | Puppet[:confdir] = confdir |
321 | 326 | Puppet[:certname] = certname |
|
0 commit comments