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

accessing custom plugin settings #64

Open
sufiyanghori opened this issue Sep 17, 2018 · 2 comments
Open

accessing custom plugin settings #64

sufiyanghori opened this issue Sep 17, 2018 · 2 comments

Comments

@sufiyanghori
Copy link

In ruby framework, I can create custom settings like,

{
  "my_custom_plugin": {
    "foo": true,
    "bar": false
  }
}

and access them in plugin,

def foo_enabled?
  settings['my_custom_plugin']['foo']
end

how can it be done in python framework?

@sufiyanghori
Copy link
Author

Found it in the code.
for anyone interested,

import utils from sensu_plugin package,

from sensu_plugin import utils

and access settings using get_settings(),

utils.get_settings()['my_custom_plugin']['foo']

@barryorourke
Copy link
Member

I'm going to reopen this with the intention of replicating the way this works in Ruby and making the settings available in the plugin base class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants