Skip to content

Commit aae6604

Browse files
committed
(FM-7819) clarify puppet device compatibility
1 parent d1f4d8d commit aae6604

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,11 @@ After the device class, transport class and transport schema have been implement
270270

271271
To allow modules to deal with different backends independently, the Resource API implements a mechanism to use different API providers side by side. For a given transport/device class (see above), the Resource API will first try to load a `Puppet::Provider::TypeName::<DeviceType>` class from `lib/puppet/provider/type_name/device_type.rb`, before falling back to the regular provider at `Puppet::Provider::TypeName::TypeName`.
272272

273-
### `puppet device` support
273+
### Puppet backwards compatibility
274274

275-
To connect to a remote resource through `puppet device`, you must call a `transport` class through a device shim to maintain compatibility with Puppet Resource.
275+
To connect to a remote resource through `puppet device`, you must provide a device shim to maintain compatibility with Puppet. The device shim needs to interface the transport to puppet's config and runtime expectations.
276276

277-
A `device` class is created that Puppet Resource will call, however this will inherit from the `transport` class which will contain the following methods (as detailed in the [Resource API specification](https://github.com/puppetlabs/puppet-specifications/tree/master/language/resource-api#transport)):
278-
* `initialize`
279-
* `verify`
280-
* `facts`
281-
* `connect`
282-
283-
For example, the `device` class will be a pass through to `transport`:
277+
In the simplest case you can use the provided `Puppet::ResourceApi::Transport::Wrapper` like this:
284278

285279
```ruby
286280
# lib/puppet/util/network_device/device_type/device.rb
@@ -290,7 +284,7 @@ require 'puppet/resource_api/transport/wrapper'
290284
# force registering the transport schema
291285
require 'puppet/transport/schema/device_type'
292286

293-
module Puppet::Util::NetworkDevice::DeviceType
287+
module Puppet::Util::NetworkDevice::Device_type
294288
class Device < Puppet::ResourceApi::Transport::Wrapper
295289
def initialize(url_or_config, _options = {})
296290
super('device_type', url_or_config)

0 commit comments

Comments
 (0)