-
-
Notifications
You must be signed in to change notification settings - Fork 272
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
Rabbitmq plugin fix #577
Rabbitmq plugin fix #577
Conversation
99ba9ea
to
d48d578
Compare
@@ -4,7 +4,9 @@ | |||
on_supported_os.each do |os, facts| | |||
context "on #{os} " do | |||
let :facts do | |||
facts | |||
facts.merge( | |||
python_dir: '/usr/local/lib/python2.7/dist-packages' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move the fact to https://github.com/voxpupuli/puppet-collectd/blob/master/spec/default_module_facts.yml?
@@ -0,0 +1,5 @@ | |||
Facter.add(:python_dir) do | |||
setcode do | |||
Facter::Util::Resolution.exec('python -c "import site; print site.getsitepackages()[0]"') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work on my local machine:
bastelfreak@tmu ~ $ python2 -c "import site; print site.getsitepackages()[0]"
Error processing line 2 of /usr/lib/python2.7/site-packages/zope.app.form-4.0.2-py2.7-nspkg.pth:
Traceback (most recent call last):
File "/usr/lib/python2.7/site.py", line 152, in addpackage
exec line
File "<string>", line 1, in <module>
KeyError: 'zope'
Remainder of file ignored
/usr/lib/python2.7/site-packages
bastelfreak@tmu ~ $ python -c "import site; print site.getsitepackages()[0]"
File "<string>", line 1
import site; print site.getsitepackages()[0]
^
SyntaxError: invalid syntax
bastelfreak@tmu ~ $ python3 -c "import site; print site.getsitepackages()[0]"
File "<string>", line 1
import site; print site.getsitepackages()[0]
^
SyntaxError: invalid syntax
bastelfreak@tmu ~ $
} | ||
|
||
default: { | ||
fail("${::osfamily} is not supported.") | ||
} | ||
} | ||
|
||
# Override with custom fact value (present only if python is installed) | ||
$python_dir = pick($::python_dir, $default_python_dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this changes the default python directory for at least debian from a collectd specific directory to the distrowide python directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the default python directory to where pip installs the package. Plugin is currently broken, as collectd is configured to look for the package where it doesn't exist (as it's installed using pip)
Fixes issue #575