Bug 680362 - remove empty directories after file removal
Summary: remove empty directories after file removal
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: Sprint 22
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: 563609 verified-to-close
TreeView+ depends on / blocked
 
Reported: 2011-02-25 09:19 UTC by Daniel Mach
Modified: 2011-08-16 12:21 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:08:33 UTC
Embargoed:


Attachments (Terms of Use)

Description Daniel Mach 2011-02-25 09:19:07 UTC
After a file is removed, some empty dirs are left on disk.
These are usually no longer needed and can be removed if empty.

Example:

$ find /var/lib/pulp/packages/
/var/lib/pulp/packages/
/var/lib/pulp/packages/2f7
/var/lib/pulp/packages/2f7/testpkg
/var/lib/pulp/packages/2f7/testpkg/1
/var/lib/pulp/packages/2f7/testpkg/1/1.el5
/var/lib/pulp/packages/2f7/testpkg/1/1.el5/noarch
/var/lib/pulp/packages/8d1
/var/lib/pulp/packages/8d1/testpkg
/var/lib/pulp/packages/8d1/testpkg/1
/var/lib/pulp/packages/8d1/testpkg/1/1.el5
/var/lib/pulp/packages/8d1/testpkg/1/1.el5/noarch

Comment 1 Todd Sanders 2011-03-23 13:46:07 UTC
Also is true for repositories.  After deleting *all* repos from Pulp server, I am left with:

/var/www/pub/repos/repos/pulp/pulp/fedora-14

vs

/var/www/pub/repos/

Comment 2 Pradeep Kilambi 2011-04-12 14:44:46 UTC
fixed! commit 3606d5f877611024acc401f4915600a724e9a8dd

* For packages:

$ sudo pulp-admin content upload pulp-cds-0.0.151-1.fc14.noarch.rpm -v --nosig
* Starting Content Upload

* Performing Content Uploads to Pulp server
Successfully uploaded [pulp-cds-0.0.151-1.fc14.noarch.rpm] to server

* Content Upload complete.

$ ls -l /var/lib/pulp/packages/pulp-cds/0.0.151/1.fc14/noarch/b44/pulp-cds-0.0.151-1.fc14.noarch.rpm 
-rw-r--r--. 1 apache apache 101655 Apr 12 10:17 /var/lib/pulp/packages/pulp-cds/0.0.151/1.fc14/noarch/b44/pulp-cds-0.0.151-1.fc14.noarch.rpm

$ sudo pulp-admin content delete -f pulp-cds-0.0.151-1.fc14.noarch.rpm
Successfully deleted content [pulp-cds-0.0.151-1.fc14.noarch.rpm] from pulp server

ls -l /var/lib/pulp/packages/pulp-cds
ls: cannot access /var/lib/pulp/packages/pulp-cds: No such file or directory

* For files:

$ ls -l /var/lib/pulp/files/3ee/test.iso 
-rw-r--r--. 1 apache apache 7864320 Mar 24 13:36 /var/lib/pulp/files/3ee/test.iso

$ sudo pulp-admin content delete -f test.iso
Successfully deleted content [test.iso] from pulp server

$ ls -l /var/lib/pulp/files/3ee
ls: cannot access /var/lib/pulp/files/3ee: No such file or directory

* For repos:

$ ls -l /var/lib/pulp/repos/testrepo2/
total 8
drwxr-xr-x. 2 apache apache 4096 Apr 11 10:06 repodata
-rw-r--r--. 1 apache apache  768 Apr 11 10:06 updateinfo.xml

$ sudo pulp-admin repo delete --id=testrepo2
Successful deleted repository [ testrepo2 ]

$ ls -l /var/lib/pulp/repos/testrepo2/
ls: cannot access /var/lib/pulp/repos/testrepo2/: No such file or directory

Comment 3 Jay Dobies 2011-04-13 19:23:03 UTC
Fixed in build 0.163.

Comment 4 Preethi Thomas 2011-04-15 16:54:20 UTC
fails-qa

[root@preethi ~]# rpm -q pulp
pulp-0.0.163-1.fc14.noarch

comment#2 still occurs with the latest build 0.163
[root@preethi ~]# ls -l /var/lib/pulp/repos/repos/pulp/pulp/testing/fedora-13
total 4
drwxr-sr-x. 3 apache apache 4096 Apr 14 10:10 x86_64
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-admin repo delete --id=f13
Successful deleted repository [ f13 ]

[root@preethi ~]# ls -l /var/lib/pulp/repos/repos/pulp/pulp/testing/fedora-1
fedora-13/ fedora-14/ 
[root@preethi ~]# ls -l /var/lib/pulp/repos/repos/pulp/pulp/testing/fedora-13/
total 0



Also for files

[root@preethi ~]# pulp-admin content upload test.txt -v* Starting Content Upload

* Performing Content Uploads to Pulp server
Successfully uploaded [test.txt] to server

* Content Upload complete.
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# ls -l /var/lib/pulp/files/
total 4
drwxr-sr-x. 2 apache apache 4096 Apr 15 13:05 a04
[root@preethi ~]# ls -l /var/lib/pulp/files/a04/test.txt 
-rw-r--r--. 1 apache apache 10 Apr 15 13:05 /var/lib/pulp/files/a04/test.txt
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-admin content delete -f test.txt 
Successfully deleted content [test.txt] from pulp server
[root@preethi ~]# ls -l /var/lib/pulp/files/
total 0

Comment 5 Pradeep Kilambi 2011-04-15 17:42:38 UTC
commit 12b548b3a172f69e29a042349eaf3c598d951948

$ sudo pulp-admin repo create --id=testdel --feed=yum:http://repos.fedorapeople.org/repos/pulp/pulp/fedora-14/x86_64/
Successfully created repository [ testdel ]

$ sudo pulp-admin repo sync -F --id=testdelSync for repository testdel started
Sync: Finished
10/10 new items downloaded
0/10 existing items processed

Item Details: 
Rpms: 10/10

$ sudo /etc/init.d/httpd restartStopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

$ sudo pulp-admin repo delete --id=testdel
Successful deleted repository [ testdel ]


$ ls -l /var/lib/pulp/repos/repos/pulp/pulp/testing/fedora-*
ls: cannot access /var/lib/pulp/repos/repos/pulp/pulp/testing/fedora-*: No such file or directory

files result looks fine; thats whats expected, the hash dir should be gone as you're seeing.

Comment 6 Jeff Ortel 2011-04-19 18:49:21 UTC
build: 0.168

Comment 7 Preethi Thomas 2011-05-04 14:47:31 UTC
verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.173-1.fc14.noarch

[root@preethi ~]# pulp-admin repo delete --id=pulp
Successful deleted repository [ pulp ]

[root@preethi ~]# ls -l /var/lib/pulp/repos/repos/pulp/pulp/testing/fedora-14/
ls: cannot access /var/lib/pulp/repos/repos/pulp/pulp/testing/fedora-14/: No such file or directory


[root@preethi ~]# ls -l /var/lib/pulp/repos/test/
total 16
lrwxrwxrwx. 1 apache apache   34 May  4 10:55 files.csv -> /var/lib/pulp//files/c6c/files.csv
lrwxrwxrwx. 1 apache apache   72 May  4 10:55 gofer-0.32-1.fc14.noarch.rpm -> ../../packages/gofer/0.32/1.fc14/noarch/af0/gofer-0.32-1.fc14.noarch.rpm
-rw-r--r--. 1 apache apache  224 May  4 10:55 MANIFEST
lrwxrwxrwx. 1 apache apache   76 May  4 10:55 pulp-0.0.168-1.fc14.noarch.rpm -> ../../packages/pulp/0.0.168/1.fc14/noarch/805/pulp-0.0.168-1.fc14.noarch.rpm
drwxr-sr-x. 2 apache apache 4096 May  4 10:55 repodata
lrwxrwxrwx. 1 apache apache   34 May  4 10:55 test2.txt -> /var/lib/pulp//files/8ff/test2.txt
lrwxrwxrwx. 1 apache apache   33 May  4 10:55 test.txt -> /var/lib/pulp//files/119/test.txt
[root@preethi ~]# pulp-admin repo delete --id=testSuccessful deleted repository [ test ]

[root@preethi ~]# ls -l /var/lib/pulp/repos/test/
ls: cannot access /var/lib/pulp/repos/test/: No such file or directory

Comment 8 Preethi Thomas 2011-08-16 12:08:33 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 9 Preethi Thomas 2011-08-16 12:21:32 UTC
Closing with Community Release 15

pulp-0.0.223-4.


Note You need to log in before you can comment on or make changes to this bug.