File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,12 @@ def register_type(definition)
4040 # Keeps a copy of the provider around. Weird naming to avoid clashes with puppet's own `provider` member
4141 define_singleton_method ( :my_provider ) do
4242 @my_provider ||= Hash . new { |hash , key | hash [ key ] = Puppet ::ResourceApi . load_provider ( definition [ :name ] ) . new }
43- @my_provider [ Puppet ::Util ::NetworkDevice . current . class ]
43+
44+ if Puppet ::Util ::NetworkDevice . current . is_a? Puppet ::ResourceApi ::Transport ::Wrapper
45+ @my_provider [ Puppet ::Util ::NetworkDevice . current . transport . class ]
46+ else
47+ @my_provider [ Puppet ::Util ::NetworkDevice . current . class ]
48+ end
4449 end
4550
4651 # make the provider available in the instance's namespace
@@ -414,7 +419,11 @@ def load_provider(type_name)
414419 nil
415420 else
416421 # extract the device type from the currently loaded device's class
417- Puppet ::Util ::NetworkDevice . current . class . name . split ( '::' ) [ -2 ] . downcase
422+ if Puppet ::Util ::NetworkDevice . current . is_a? Puppet ::ResourceApi ::Transport ::Wrapper
423+ Puppet ::Util ::NetworkDevice . current . schema . name
424+ else
425+ Puppet ::Util ::NetworkDevice . current . class . name . split ( '::' ) [ -2 ] . downcase
426+ end
418427 end
419428 device_class_name = class_name_from_type_name ( device_name )
420429
You can’t perform that action at this time.
0 commit comments