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
Fix directory /etc/nagios/nrpe.d/ issue #492
Conversation
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 solves the problem but a simpler solution would do.
The charm is running as root and even if it sets permissions as nagios it is capable of doing that if the directory exists. A simple directory check would do.
|
||
# check that the charm can write to the conf dir. If not, then nagios | ||
# probably isn't installed, and we can defer. | ||
if not self.can_write_nrpe_conf_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.
Can we not just do a directory check?
if os.path.exists(cls.nrpe_confdir):
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 is great, just waiting on the OSCI run for landing.
Under certain deployment conditions, the charm can attempt to write to the /etc/nagios/nrpe.d/ directory before it exists. This directory is created by the nrpe charm, but if the hacluster gets installed first, then it can be triggered to attempt to set up the nrpe entries before the directory can be created by nrpe. This change (and the associated charm-helpers change) ensures that the charm will delay the nrpe config until the directory is available (and thus, the nrpe charm is fully installed) Related Bug: LP: #1882557
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.
Looks good. Landing.
Under certain deployment conditions, the charm can attempt to write to the /etc/nagios/nrpe.d/ directory before it exists. This directory is created by the nrpe charm, but if the hacluster (this charm) gets installed first, then it can be triggered to attempt to set up the nrpe entries before the directory can be created by nrpe. This change (and the associated charm-helpers change) ensures that the charm will delay the nrpe config until the directory is available (and thus, the nrpe charm is fully installed) Related charm-helpers: juju/charm-helpers#492 Change-Id: Ibcbb5f56205b72c475807e3c34c64a00844908f4 Closes-Bug: #1882557
* Update charm-hacluster from branch 'master' - Merge "Fix directory /etc/nagios/nrpe.d/ issue" - Fix directory /etc/nagios/nrpe.d/ issue Under certain deployment conditions, the charm can attempt to write to the /etc/nagios/nrpe.d/ directory before it exists. This directory is created by the nrpe charm, but if the hacluster (this charm) gets installed first, then it can be triggered to attempt to set up the nrpe entries before the directory can be created by nrpe. This change (and the associated charm-helpers change) ensures that the charm will delay the nrpe config until the directory is available (and thus, the nrpe charm is fully installed) Related charm-helpers: juju/charm-helpers#492 Change-Id: Ibcbb5f56205b72c475807e3c34c64a00844908f4 Closes-Bug: #1882557
Under certain deployment conditions, the charm can attempt to write to
the /etc/nagios/nrpe.d/ directory before it exists. This directory is
created by the nrpe charm, but if the hacluster gets installed first,
then it can be triggered to attempt to set up the nrpe entries before
the directory can be created by nrpe. This change (and the associated
charm-helpers change) ensures that the charm will delay the nrpe config
until the directory is available (and thus, the nrpe charm is fully
installed)
Related Bug: LP: #1882557