Method: Puppet::Type#suitable?
- Defined in:
- lib/puppet/type.rb
#suitable? ⇒ Boolean
Returns true if this is something else than a :provider, or if it is a provider and it is suitable, or if there is a default provider. Otherwise, false is returned.
1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 |
# File 'lib/puppet/type.rb', line 1923 def suitable? # If we don't use providers, then we consider it suitable. return true unless self.class.paramclass(:provider) # We have a provider and it is suitable. return true if provider && provider.class.suitable? # We're using the default provider and there is one. if !provider and self.class.defaultprovider self.provider = self.class.defaultprovider.name return true end # We specified an unsuitable provider, or there isn't any suitable # provider. false end |