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

Add syslog-ng state and execution module #14033

Merged
merged 2 commits into from Jul 10, 2014

Conversation

ihrwein
Copy link
Contributor

@ihrwein ihrwein commented Jul 8, 2014

Syslog-ng is an open source logging daemon. This pull request contains a state and an execution modul for it.

The state module is able to generate syslog-ng configuration from YAML format, and start, stop or reload syslog-ng. The commit id of the patch is: 80f84196231db7f1a232194e3dcb6eacb3ae3583.

The execution module can check the version of the generated configuration or get some information about syslog-ng, e.g. version.

This pull request requires #14032 to be accepted.

@ghost
Copy link

ghost commented Jul 8, 2014

Test Failed.

If the failures are unrelated to your code, don't stress, a core developer will know these apart.
In the future, if possible, please branch off a passing commit to avoid false positives.
Refer to this link for build results: http://jenkins.saltstack.com/job/salt-pr-build/5870/

s_gsoc2014:
syslog_ng.config:
- config:
source:
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, nested dicts like this can be confusing for users, if a data structure that is not as deeply nested works or uses a list can be used it would be better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to find the most natural representation of a syslog-ng configuration as a YAML document. I use this kind of format, because syslog-ng's configuration can be deeply nested.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good :)

@thatch45
Copy link
Member

thatch45 commented Jul 8, 2014

@ghost
Copy link

ghost commented Jul 9, 2014

Test Failed.

If the failures are unrelated to your code, don't stress, a core developer will know these apart.
In the future, if possible, please branch off a passing commit to avoid false positives.
Refer to this link for build results: http://jenkins.saltstack.com/job/salt-pr-build/5893/

@ghost
Copy link

ghost commented Jul 9, 2014

Test Failed.

If the failures are unrelated to your code, don't stress, a core developer will know these apart.
In the future, if possible, please branch off a passing commit to avoid false positives.
Refer to this link for build results: http://jenkins.saltstack.com/job/salt-pr-build/5898/

@ghost
Copy link

ghost commented Jul 9, 2014

Test Failed.

If the failures are unrelated to your code, don't stress, a core developer will know these apart.
In the future, if possible, please branch off a passing commit to avoid false positives.
Refer to this link for build results: http://jenkins.saltstack.com/job/salt-pr-build/5902/

@ihrwein
Copy link
Contributor Author

ihrwein commented Jul 10, 2014

As far as I know the failure isn't caused by my patch. Could you check it, please?

thatch45 added a commit that referenced this pull request Jul 10, 2014
Add syslog-ng state and execution module
@thatch45 thatch45 merged commit 9bcadf3 into saltstack:develop Jul 10, 2014
@thatch45
Copy link
Member

Looks good! Thanks!

@terminalmage
Copy link
Contributor

I've made some style fixes (see the coding style guide) in this pull request.

@ihrwein Can you please address why this state is full of print statements? States should never, EVER, print. They should return data, which is then stored in the job cache and also printed by the master. See here for more info.

Also, I noticed that this state has a number of functions which don't appear to be stateful tasks at all:

  • set_config_file
  • write_version
  • set_binary_path

These all seem like actions that should be taken in the execution module, not in the state. The same goes for most of the private functions (those beginning with an underscore).

The general rule in Salt is that execution modules do the work, and states just leverage functions from the execution modules to do things. The states should be little more than logic and calls to execution functions.

@terminalmage terminalmage mentioned this pull request Jul 12, 2014
@terminalmage
Copy link
Contributor

I talked with @thatch45 and we decided to move this state and execution module to salt-contrib so it can be refined there. Once all issues are addressed, we'll definitely move it back.

Once this is merged, the state and execution module will be merged into salt-contrib and you can make further pull requests against that repository.

Thanks for all the work you put into this. We're excited to get this added to Salt, we just need it to be refined a bit.

@ihrwein
Copy link
Contributor Author

ihrwein commented Jul 16, 2014

Thanks you for your reply!

About print statements

You can see, that I don't use stdin or stderr in print statement, I just fill a buffer with it, there is no exception. Is this OK?

About the mentioned functions

I think I had some misconception here. I will move all functions to the execution module except config (the real logic will be in the exec. module).

@ihrwein
Copy link
Contributor Author

ihrwein commented Jul 27, 2014

I think I refined it, could you take a look at the result? Should I make
any other changes or it is ready to be merged to salt's develop branch?

After the merge, I would update the docs in salt's develop branch.

2014-07-12 18:45 GMT+02:00 Erik Johnson notifications@github.com:

I talked with @thatch45 https://github.com/thatch45 and we decided to
move this state and execution module to salt-contrib
https://github.com/saltstack/salt-contrib so it can be refined there.
Once all issues are addressed, we'll definitely move it back.

Once this vmware-archive/salt-contrib#84 is merged,
the state and execution module will be merged into salt-contrib and you can
make further pull requests against that repository.

Thanks for all the work you put into this. We're excited to get this added
to Salt, we just need it to be refined a bit.


Reply to this email directly or view it on GitHub
#14033 (comment).

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

Successfully merging this pull request may close these issues.

None yet

3 participants