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

Rabbitmq plugin fix #577

Merged
merged 8 commits into from
Dec 1, 2016
Merged

Conversation

jskarpe
Copy link
Contributor

@jskarpe jskarpe commented Nov 7, 2016

Fixes issue #575

@@ -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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,5 @@
Facter.add(:python_dir) do
setcode do
Facter::Util::Resolution.exec('python -c "import site; print site.getsitepackages()[0]"')
Copy link
Member

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)
Copy link
Member

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?

Copy link
Contributor Author

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)

@bastelfreak bastelfreak merged commit 975daf3 into voxpupuli:master Dec 1, 2016
@jskarpe jskarpe deleted the rabbitmq_plugin_fix branch December 1, 2016 08:42
@bastelfreak bastelfreak added the bug Something isn't working label Feb 13, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants