Skip to content

Add a dummy provider, remove 'defaultfor' from all other providers. #35

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 8 commits into from
Oct 31, 2012

Conversation

sodabrew
Copy link

Resolves warning about multiple default providers for :vcsrepo.

See:
http://projects.puppetlabs.com/issues/16958
http://projects.puppetlabs.com/issues/6403

…esolves warning about multiple default providers for :vcsrepo.
@glarizza
Copy link

Doing the following works:

vcsrepo { '/tmp/plist':
  ensure => present,
  provider => git,
  source => 'https://github.com/glarizza/puppet-property_list_key.git',
}

Doing the following:

vcsrepo { '/tmp/plist':
  ensure => present,
  source => 'https://github.com/glarizza/puppet-property_list_key.git',
}

Gives the following error:

err: /Vcsrepo[/tmp/plist]: Could not evaluate: undefined method `working_copy_exists?' for #<Puppet::Type::Vcsrepo::ProviderDummy:0xb57b35bc>

@sodabrew
Copy link
Author

I think there's a way to have a "magic method" that will respond to any undefined method in the class. That method would log a warning rather than blowing up the puppet run. I'll get right on it!

(There's no such magic in ruby, so I'll use working_copy_exists? which is always called for vcsrepo providers).

@glarizza
Copy link

Go for it - we're all hanging around the office and looking to merge in pull requests. Just register a comment here when/if you find something! :)

@sodabrew
Copy link
Author

Bunch of cleanups and junk to get tests running again and passing. Finally then, added an exception to the dummy provider, and a test to check for the exception. Here's what it looks like running, with a bogus resource:

  vcsrepo {'/tmp/foo': }

This output is seen in a puppetized node:

  err: /Vcsrepo[/tmp/foo]: Could not evaluate: vcsrepo resource must have a provider, available: bzr, cvs, git, hg, svn

Conflicts:
	lib/puppet/provider/vcsrepo/cvs.rb
	spec/support/fixture_helpers.rb
	spec/unit/puppet/provider/vcsrepo/cvs_spec.rb
@sodabrew
Copy link
Author

Merged from master, ready to integrate. I reverted #27, it broke all of the git unit tests.

@sodabrew
Copy link
Author

Ping? Vcsrepo 0.1.0 is basically unusable until this is resolved, I'd love to see this merged and bumped to 0.1.1. Then we can tackle the default user issue and some of the other git inefficiencies. I have more code to submit pending this merge.

@glarizza
Copy link

I merged in the commit that broke vcsrepo, so I'll take this one. Let me pull your branch, run the tests, and see about getting this merged in tonight

@glarizza
Copy link

I've pulled in the changes, run the spec tests, and they're passing. Applying the test from before gets the following:

info: Applying configuration version '1351643948'
err: /Vcsrepo[/tmp/plist]: Could not evaluate: vcsrepo resource must have a provider, available: bzr, cvs, git, hg, svn
info: Creating state file /Users/glarizza/.puppet/var/state/state.yaml
notice: Finished catalog run in 0.02 seconds

I'm satisfied with the changes - merging this in!

glarizza pushed a commit that referenced this pull request Oct 31, 2012
Add a dummy provider, remove 'defaultfor' from all other providers.
@glarizza glarizza merged commit 8b0df4b into puppetlabs:master Oct 31, 2012
@sodabrew
Copy link
Author

Yay, thank you!

@glarizza
Copy link

A new release was cut for the Forge --> http://forge.puppetlabs.com/users/puppetlabs/modules/vcsrepo/releases/0.1.1

@glarizza
Copy link

And all tests passing in TravisCI --> https://travis-ci.org/#!/sodabrew/puppetlabs-vcsrepo/builds/2962633 Ahhh yisssss

@lieutdan13
Copy link

This is very interesting because I'm still seeing this warning. I have verified that I do in fact have the latest code in my puppet master and that I'm only seeing the defaultfor for the dummy. Is it possible that the duplicate defaultfor settings are being cached on the master? FWIW, I'm using the latest gitlab module that uses vcsrepo. The module has this in one of the manifests:

Vcsrepo {
  ensure   => $ensure,
  provider => 'git',
  user     => $git_user,
}

Could this be the cause of my issue?

@zonzamas
Copy link

I force git provider as well and I get the following
Warning: Found multiple default providers for vcsrepo: dummy, git; using dummy

Using vcsrepo 1.0.1 and puppet 3.6.2

@eat24john
Copy link

I'm seeing the same thing.
Tried multiple versions of puppet (3.6.0 -> 3.6.2) with vcsrepo 1.0.1 i'm getting "Warning: Found multiple default providers for vcsrepo: cvs, dummy, svn, git, hg, bzr; using cvs". Sometimes I get Warning: Found multiple default providers for vcsrepo: cvs, dummy, svn, git, hg, bzr; using dummy"

@jangrewe
Copy link

Same here, i get "Warning: Found multiple default providers for vcsrepo: dummy, git, p4; using dummy" with Puppet 3.6.2 and VCSRepo 1.0.2

@glennaaldering
Copy link

Warning: Found multiple default providers for vcsrepo: git, p4, dummy; using git

puppet 3.6.2
puppetlabs-vcsrepo 1.1.0

@sodabrew
Copy link
Author

sodabrew commented Aug 1, 2014

Yep, this definitely has become an open issue again with Puppet 3.6 :|

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants