Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
The cron.weekly job put in place to clean empty puppet environments will now have situations where there are no KT_* environments to clean up. In this situation, the find command fails and an error is output. We should redirect the errors to null (hide them) or come up with a different command.
Version-Release number of selected component (if applicable):
Satellite 6.2.2.1
How reproducible:
100%
Steps to Reproduce:
1. Install Satellite 6.2
2. Have no publshed puppet environments. (KT_* folders are no longer created for content-views, so on if not modules are published)
3. Run /etc/cron.weekly/katello-clean-empty-puppet-environments
Actual results:
find: ‘/etc/puppet/environments/KT*’: No such file or directory
Expected results:
No errors from script output
Additional info:
Since the only purpose is to clean out unused puppet environments, we could simply add '> /dev/null 2>&1' to the end of the scripts `find` command.
Sure thing,
We can go this route instead:
#!/bin/bash
if [ -d /etc/puppet/environments ];then
if ls /etc/puppet/environments | grep KT; then
find /etc/puppet/environments/KT* -maxdepth 0 -type d -empty -delete
fi
fi
VERIFIED.
@satellite-6.2.7-1.0.el7sat.noarch
katello-common-3.0.0-15.el7sat.noarch
used manual reproducer from comment#0
# ls /etc/puppet/environments/KT*
ls: cannot access /etc/puppet/environments/KT*: No such file or directory
# /etc/cron.weekly/katello-clean-empty-puppet-environments
<empty>
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2017:0197