[entropy.server.mirrors] tidy_mirrors: make sure to clean the upload/ directory as well

This commit is contained in:
Fabio Erculiani
2012-09-21 14:57:48 +02:00
parent 4812e3365d
commit 21e2251008

View File

@@ -2232,12 +2232,16 @@ class Server(object):
package_path = self._entropy.complete_local_package_path(
package_rel, repository_id)
# if package files are stuck in the upload/ directory
# it means that the repository itself has never been pushed
up_package_path = self._entropy.complete_local_upload_package_path(
package_rel, repository_id)
package_path_expired = package_path + \
etpConst['packagesexpirationfileext']
# .expired for all the paths in removal doesn't sound
# that ok but since we handle ENOENT, that's fine
my_rm_list = (package_path, package_path_expired)
my_rm_list = (package_path, up_package_path, package_path_expired)
for myfile in my_rm_list:
try:
os.remove(myfile)