Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Dupilicate declaration for requirement file #112

Closed
samho opened this issue Aug 11, 2014 · 3 comments
Closed

Dupilicate declaration for requirement file #112

samho opened this issue Aug 11, 2014 · 3 comments
Labels
bug Something isn't working

Comments

@samho
Copy link

samho commented Aug 11, 2014

I try to do below steps:

  1. Get the requirement file from master server, and save to /tmp/ directory
  2. Create the virtualenv and install package with the requirement file which has been saved in /tmp directory.

But when I try to so, there is always an error appeared, it shows as below:
Error: Failed to apply catalog: Duplicate declaration: File[/tmp/requirement.txt] is already declared in file /etc/puppet/modules/general/manifests/init.pp:7; cannot redeclare at /etc/puppet/modules/python/manifests/requirements.pp:98

it means "path parameter" of file resource and "requirements parameter" of python::virtualenv cannot be same, but this is not make sense, please fix it.

@rcmachado
Copy link

Just FYI, tested it with the following manifest and could not reproduce the bug:

class { 'python':
  version    => 'system',
  dev        => true,
  virtualenv => true,
}

file { '/tmp/requirements.txt':
  ensure  => present,
  content => '# nothing',
}

python::virtualenv { '/var/www/project1':
  ensure       => present,
  version      => 'system',
  requirements => '/tmp/requirements.txt',
  systempkgs   => true,
}

python::requirements { '/tmp/requirements.txt':
  virtualenv => '/var/www/project1',
}

Looks like this line https://github.com/stankevich/puppet-python/blob/bd1e2cf705589448dc08f76ed080cae5efce99e4/manifests/requirements.pp#L105 prevents this error.

@JamesWiley
Copy link

I'm glad this post is here because I was running into a similar problem. The post above seems like a non-intuitive way to use the module. Why does the python::requirements class need to be invoked along with python::virtualenv? It seems like both statements would accomplish populating a virtualenv independently or am I misunderstanding something?

@shivapoudel
Copy link
Contributor

@rcmachado Thank you for the explanation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants