Bug 1385177
Summary: | katello-clean-empty-puppet-environments cron.weekly job needs to hide errors when trying to delete non-existent folders | |||
---|---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Craig Donnelly <cdonnell> | |
Component: | Infrastructure | Assignee: | Chris Roberts <chrobert> | |
Status: | CLOSED ERRATA | QA Contact: | Lukas Pramuk <lpramuk> | |
Severity: | low | Docs Contact: | ||
Priority: | low | |||
Version: | 6.2.2 | CC: | adprice, bbuckingham, bkearney, chrobert, ehelms, hartsjc, jcallaha, lpramuk, oshtaier | |
Target Milestone: | Unspecified | Keywords: | Triaged | |
Target Release: | Unused | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
URL: | http://projects.theforeman.org/issues/17047 | |||
Whiteboard: | ||||
Fixed In Version: | katello-3.0.0-15 | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1399338 1405485 (view as bug list) | Environment: | ||
Last Closed: | 2017-01-26 10:43:03 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1399338, 1405485 |
Description
Craig Donnelly
2016-10-14 21:37:43 UTC
better than ignoring possibly legitimate errors would be to check for the existence of the directory before doing the find. 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 This has actually already been taken care of upstream. The new cron looks like this: $ cat katello-clean-empty-puppet-environments #!/bin/bash # Puppet 4 [ -d /etc/puppetlabs/code/environments ] && find /etc/puppetlabs/code/environments/KT* -maxdepth 0 -type d -empty -delete # Puppet 3 [ -d /etc/puppet/environments ] && find /etc/puppet/environments/KT* -maxdepth 0 -type d -empty -delete This just needs to be pulled down into Satellite 6.2. Solved in: https://github.com/Katello/katello-packaging/commit/f7b70e71ecaf99cd9de375d75d0880d4f3d5c3be and https://github.com/Katello/katello-packaging/commit/5846981719e9bd6a5617daf7078b8729dbb1e5f0 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 |