Bug 807516 - Deleting a repository does not affect repoids associated with a package.
Summary: Deleting a repository does not affect repoids associated with a package.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.0.0
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: Unspecified
Assignee: Katello Bug Bin
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: 806068
TreeView+ depends on / blocked
 
Reported: 2012-03-28 03:10 UTC by Brad Buckingham
Modified: 2019-09-26 13:33 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-22 18:32:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Brad Buckingham 2012-03-28 03:10:54 UTC
Description of problem:

In pulp, it is possible for multiple repositories (e.g. repo1 & repo2) to contain the same package (e.g. pkg1).  If one of those repositories (repo1) is deleted and the user lists the packages associated with the second repo (repo2), the repoids field continues to include the deleted repo.

This is an issue for System Engine.  The reason being, when a repository is synced SE will index the packages in the repo for fast access by the SE search engine.  Then when a repo is deleted, SE will remove those indices.  Since the content used to create the index is the package info from pulp, the indices will be incorrect.  Over time, this can cause the SE search engine to contain invalid data that will not be cleaned up without manually reindexing the content which can be expensive.

Resolution to this issue is needed to resolve bug 806068.

Version-Release number of selected component (if applicable):
pulp-1.0.0-6.fc15.noarch

How reproducible:
always

Steps to Reproduce:
1. create 2 repos that contain the same packages (e.g. zoo & zoo2)
2. sync the 2 repos
3. delete one of the repos (e.g. zoo)
  
Actual results:

# observe that the first repo was deleted
$ curl -k -u admin:admin https://localhost/pulp/api/repositories/ACME_Corporation-zoo-zoo/packages/
"No repository ACME_Corporation-zoo-zoo"

# observe that the package includes the deleted repo in the repoids field
$ curl -k -u admin:admin https://localhost/pulp/api/repositories/ACME_Corporation-zoo-zoo2/packages/|prettify_json.rb
...
...
...

  {
    "requires": [

    ],
    "filename": "kangaroo-0.2-1.noarch.rpm",
    "name": "kangaroo",
    "repoids": [
      "ACME_Corporation-zoo-zoo",
      "ACME_Corporation-zoo-zoo2"
    ],
    "license": "GPLv2",
    "id": "83690698-9617-4039-9fd1-d8690284452f",
    "arch": "noarch",
    "buildhost": "smqe-ws15",
    "size": 2467,
    "_id": "83690698-9617-4039-9fd1-d8690284452f",
    "release": "1",
    "description": "A dummy package of kangaroo",
    "checksum": {
      "sha256": "9416cbe9e8c183f440ed590d66d56d471d529a4cf67930cea8bd7056df5ca91c"
    },
    "version": "0.2",
    "vendor": "",
    "group": "Internet/Applications",
    "download_url": "https://localhost//pulp/repos/ACME_Corporation/Library/custom/zoo/zoo2/kangaroo-0.2-1.noarch.rpm",
    "repo_defined": true,
    "_ns": "packages",
    "provides": [
      "kangaroo"
    ],
    "epoch": "0"
  }
]

Expected results:

In the above case, repoids should be:
    "repoids": [
      "ACME_Corporation-zoo-zoo2"
    ],

Additional info:

Comment 1 Mike McCune 2012-03-28 03:30:31 UTC
looks like the repo API in the delete() method needs to go through each package and remove the repoid from the field in the package object

Comment 2 Mike McCune 2012-03-28 05:22:07 UTC
possible patch, untested:

diff --git a/src/pulp/server/api/repo.py b/src/pulp/server/api/repo.py
index f38cde1..21f83f5 100644
--- a/src/pulp/server/api/repo.py
+++ b/src/pulp/server/api/repo.py
@@ -593,6 +593,13 @@ class RepoApi(BaseApi):
                 log.debug(
                     'package "%s" has references, not deleted',
                     pkgid)
+                # Remove the repoid from the package since 
+                # we are not deleting the package
+                package = self.packageapi.package(pkgid)
+                repoids = package["repoids"]
+                if repoids.count(id) > 0:
+                    repoids.remove(id)
+                    self.packageapi.update(pkgid, {'repoids': repoids})
             except Exception, ex:
                 log.exception(ex)
 
can be applied to:


/usr/lib/python2.6/site-packages/pulp/server/api/repo.py

Comment 3 Brad Buckingham 2012-03-28 09:14:57 UTC
Mike, Thanks!!

Ran a quick test of the patch and the results look positive.  The following is the output from the same example as in the description (after the deletion of the 'zoo' repo).

$ curl -k -u admin:admin
https://localhost/pulp/api/repositories/ACME_Corporation-zoo-zoo2/packages/|prettify_json.rb
...
...
  {
    "description": "A dummy package of cow",
    "epoch": "0",
    "buildhost": "smqe-ws15",
    "repo_defined": true,
    "license": "GPLv2",
    "provides": [
      "cow"
    ],
    "name": "cow",
    "release": "3",
    "checksum": {
      "sha256": "b381022c4fa63caaa840778a9c39864f85a372253c94155595bf023af5e9daff"
    },
    "id": "b78403a9-33cc-4d84-8122-c6fb78cc2461",
    "filename": "cow-2.2-3.noarch.rpm",
    "_id": "b78403a9-33cc-4d84-8122-c6fb78cc2461",
    "repoids": [
      "ACME_Corporation-zoo-zoo2"
    ],
    "download_url": "https://localhost//pulp/repos/ACME_Corporation/Library/custom/zoo/zoo2/cow-2.2-3.noarch.rpm",
    "vendor": "",
    "size": 2420,
    "version": "2.2",
    "arch": "noarch",
    "group": "Internet/Applications",
    "_ns": "packages",
    "requires": [

    ]
  }
]

Comment 4 Brad Buckingham 2012-03-28 10:28:30 UTC
The same issue exists for errata.  We'll also need to update them to remove the repoid.  The following is an example after the zoo repo was deleted:

$ curl -k -u admin:admin https://localhost/pulp/api/repositories/ACME_Corporation-zoo-zoo2/errata/|prettify_json.rb
[
  {
    "severity": "",
    "type": "security",
    "id": "RHEA-2012:0002",
    "repoids": [
      "ACME_Corporation-zoo-zoo",
      "ACME_Corporation-zoo-zoo2"
    ],
    "title": "Sea_Erratum",
    "_id": "RHEA-2012:0002"
  },
...
...

Comment 5 John Matthews 2012-03-28 17:17:55 UTC
Here's an update.

1) Incoporated Mike's patch from comment #2 into Pulp.
2) Added same functionality for errata
 a) Errata delete under RepoApi was iterating over wrong key, so fixed this as well
3) Examined Distributions
 a) Delete was working correctly and repoids was being cleaned up
 b) Create was broken, we weren't correctly updating repoids, this is now fixed.
4) Looked at 'Files', we never stored 'repoids' for this object, so I left it alone and did not make any changes for it.

I am in the process running through unit tests and verifying no further breakages.  Expect to commit a change around ~2pm today.

Comment 7 Jeff Ortel 2012-03-29 00:15:27 UTC
build: 1.0.1-1

Comment 8 Preethi Thomas 2012-03-29 02:18:20 UTC
[root@pulp-v1-server ~]# rpm -q pulp
pulp-1.0.1-1.el6.noarch

[root@pulp-v1-server ~]# pulp-admin repo create --id=zoo --feed=http://inecas.fedorapeople.org/fakerepos/zoo/
Successfully created repository [ zoo ]

[root@pulp-v1-server ~]# pulp-admin repo create --id=zoo2 --feed=http://inecas.fedorapeople.org/fakerepos/zoo/ --relativepath zoo2
Successfully created repository [ zoo2 ]

[root@pulp-v1-server ~]# pulp-admin repo sync --id zoo -FSync for repository zoo started
Sync: Finished
32/32 new items downloaded
0/32 existing items processed

Item Details: 
RPMs: 32/32

[root@curl -k -u admin:admin  https://localhost/pulp/api/repositories/zoo2/packages/

 {
      "size":2464,
      "license":"GPLv2",
      "_id":"823e3440-68ce-4c2d-845d-91a86ccaec0e",
      "vendor":"",
      "name":"penguin",
      "repo_defined":true,
      "checksum":{
         "sha256":"57d314cc6f5322484cdcd33f4173374de95c53034de5b1168b9291ca0ad06dec"
      },
      "requires":[
         "dolphin"
      ],
      "epoch":"0",
      "download_url":"https://pulp-v1-server.usersys.redhat.com//pulp/repos/fakerepos/zoo/penguin-0.9.1-1.noarch.rpm",
      "filename":"penguin-0.9.1-1.noarch.rpm",
      "repoids":[
         "zoo2",
         "zoo"
      ],
      "version":"0.9.1",
      "provides":[
         "penguin"
      ],
      "_ns":"packages",
      "release":"1",
      "group":"Internet/Applications",
      "buildhost":"smqe-ws15",
      "arch":"noarch",
      "id":"823e3440-68ce-4c2d-845d-91a86ccaec0e",
      "description":"A dummy package of penguin"
   },
   {
      "size":2465,
      "license":"GPLv2",
      "_id":"74ba20e8-f3e9-473d-a7e1-5738e78c3995",
      "vendor":"",
      "name":"trout",
      "repo_defined":true,
      "checksum":{
         "sha256":"aea91d73d8df21502fecbc1bbf64e7cfdd61751a1ba2730939d57fc842602e14"
      },
      "requires":[
         "horse",
         "cat"
      ],
      "epoch":"0",
      "download_url":"https://pulp-v1-server.usersys.redhat.com//pulp/repos/fakerepos/zoo/trout-0.12-1.noarch.rpm",
      "filename":"trout-0.12-1.noarch.rpm",
      "repoids":[
         "zoo2",
         "zoo"
      ],

[root@pulp-v1-server ~]# pulp-admin repo delete --id=zooRepository [ zoo ] being deleted

[root@pulp-v1-server ~]# curl -k -u admin:admin  https://localhost/pulp/api/repositories/zoo/
"No repository zoo"[root@pulp-v1-server ~]# 

[root@curl -k -u admin:admin  https://localhost/pulp/api/repositories/zoo2/packages/


{
      "license":"GPLv2",
      "_id":"823e3440-68ce-4c2d-845d-91a86ccaec0e",
      "vendor":"",
      "name":"penguin",
      "repo_defined":true,
      "checksum":{
         "sha256":"57d314cc6f5322484cdcd33f4173374de95c53034de5b1168b9291ca0ad06dec"
      },
      "description":"A dummy package of penguin",
      "download_url":"https://pulp-v1-server.usersys.redhat.com//pulp/repos/fakerepos/zoo/penguin-0.9.1-1.noarch.rpm",
      "buildhost":"smqe-ws15",
      "repoids":[
         "zoo2"
      ],
      "epoch":"0",
      "version":"0.9.1",
      "arch":"noarch",
      "provides":[
         "penguin"
      ],
      "_ns":"packages",
      "release":"1",
      "group":"Internet/Applications",
      "filename":"penguin-0.9.1-1.noarch.rpm",
      "requires":[
         "dolphin"
      ],
      "id":"823e3440-68ce-4c2d-845d-91a86ccaec0e",
      "size":2464
   },
   {
      "license":"GPLv2",
      "_id":"74ba20e8-f3e9-473d-a7e1-5738e78c3995",
      "vendor":"",
      "name":"trout",
      "repo_defined":true,
      "checksum":{
         "sha256":"aea91d73d8df21502fecbc1bbf64e7cfdd61751a1ba2730939d57fc842602e14"
      },
      "description":"A dummy package of trout",
      "download_url":"https://pulp-v1-server.usersys.redhat.com//pulp/repos/fakerepos/zoo/trout-0.12-1.noarch.rpm",
      "buildhost":"smqe-ws15",
      "repoids":[
         "zoo2"
      ],

Comment 9 Preethi Thomas 2012-03-29 02:26:48 UTC
[[root@pulp-v1-server ~]# curl -k -u admin:admin  https://localhost/pulp/api/repositories/zoo2/errata/

   {
      "severity":"",
      "title":"Sea_Erratum",
      "_id":"RHEA-2012:0002",
      "type":"security",
      "id":"RHEA-2012:0002",
      "repoids":[
         "zoo2"
      ]
   },
   {
      "severity":"",
      "title":"Bird_Erratum",
      "_id":"RHEA-2012:0003",
      "type":"security",
      "id":"RHEA-2012:0003",
      "repoids":[
         "zoo2"
      ]
   },
   {
      "severity":"",
      "title":"Bear_Erratum",
      "_id":"RHEA-2012:0001",
      "type":"security",
      "id":"RHEA-2012:0001",
      "repoids":[
         "zoo2"
      ]
   },
   {
      "severity":"",
      "title":"Gorilla_Erratum",
      "_id":"RHEA-2012:0004",
      "type":"security",
      "id":"RHEA-2012:0004",
      "repoids":[
         "zoo2"
      ]
   }
]

Comment 10 Preethi Thomas 2012-03-29 02:53:41 UTC
fails_qa

verified the cases with errata & packages see above 2 comments

but for distribution each time I cloned repo repo id was added twice. so when the repo is deleted, only one repo from the 2 that were added was deleted.

[root@pulp-v1-server ~]# pulp-admin repo list 
+------------------------------------------+
       List of Available Repositories
+------------------------------------------+
        
    

Id                 	f16                      
Name               	f16                      
Repo URL           	https://pulp-v1-server.usersys.redhat.com/pulp/repos/released/F-16/GOLD/Fedora/x86_64/os/
Feed URL           	http://download.devel.redhat.com/released/F-16/GOLD/Fedora/x86_64/os/
Feed Type          	remote                   
Content Type       	yum                      
Feed Certs         	CA:No   Cert:No
Consumer Certs     	CA:No   Cert:No
Architecture       	noarch                   
Sync Schedule      	None                     
Packages           	3107                     
Files              	0                        
Distributions      	ks-Fedora-Fedora-16-x86_64
Publish            	True                     
Clones             	[u'f16-clone1']          
Groups             	None                     
Filters            	[]                       
Notes              	{}                       
Preserve Metadata  	False                    
Checksum Type      	sha256                   


Id                 	f16-clone1               
Name               	f16-clone1               
Repo URL           	https://pulp-v1-server.usersys.redhat.com/pulp/repos/f16-clone1/
Feed URL           	http://download.devel.redhat.com/released/F-16/GOLD/Fedora/x86_64/os/
Feed Type          	remote                   
Content Type       	yum                      
Feed Certs         	CA:No   Cert:No
Consumer Certs     	CA:No   Cert:No
Architecture       	noarch                   
Sync Schedule      	None                     
Packages           	3107                     
Files              	0                        
Distributions      	ks-Fedora-Fedora-16-x86_64
Publish            	True                     
Clones             	[]                       
Groups             	None                     
Filters            	[]                       
Notes              	{}                       
Preserve Metadata  	False                    
Checksum Type      	sha256                   


[root@pulp-v1-server ~]# 


[root@pulp-v1-server ~]# curl -k -u admin:admin  https://localhost/pulp/api/repositories/f16/distribution/ |json_reformat
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
104  1042    0  1042    0     0   2038      0 --:--:-- --:--:-- --:--:--  2255
[
  {
    "files": [
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/initrd.img",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/boot.iso",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/efiboot.img",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/repomd.xml",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/.treeinfo",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/vmlinuz",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/efidisk.img"
    ],
    "description": "ks-Fedora-Fedora-16-x86_64",
    "family": "Fedora",
    "url": [
      "http://pulp-v1-server.usersys.redhat.com/pulp/ks/released/F-16/GOLD/Fedora/x86_64/os/",
      "http://pulp-v1-server.usersys.redhat.com/pulp/ks/f16-clone1/"
    ],
    "relativepath": "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64",
    "variant": "Fedora",
    "id": "ks-Fedora-Fedora-16-x86_64",
    "version": "16",
    "timestamp": "2011-11-02T23:10:12",
    "_id": "ks-Fedora-Fedora-16-x86_64",
    "arch": "x86_64",
    "_ns": "distribution",
    "repoids": [
      "f16",
      "f16-clone",
      "f16-clone1",
      "f16-clone1"
    ]
  }
]


see f16-clone above which I had already deleted and f16-clone1 which is added twice.

Comment 11 John Matthews 2012-03-29 13:02:30 UTC
Fixed with below commit:

http://git.fedorahosted.org/git/?p=pulp.git;a=commitdiff;h=2c76534652cd59082f9cc1589e11abdef3f4a6a2


Main fix is here, rest of commit is a new unit test to verify this is fixed.

diff --git a/src/pulp/server/api/repo_sync.py b/src/pulp/server/api/repo_sync.py
index a840d9e..ec66d83 100644 (file)
--- a/src/pulp/server/api/repo_sync.py
+++ b/src/pulp/server/api/repo_sync.py
@@ -168,7 +168,8 @@ def _clone(clone_id, id, clone_name, feed='parent', relative_path=None, groupid=
     # Update repoids on distributions
     for distro_id in cloned_repo["distributionid"]:
         distro = distro_api.distribution(distro_id)
-        distro["repoids"].append(clone_id)
+        if clone_id not in distro["repoids"]:
+            distro["repoids"].append(clone_id)
         distro_api.collection.save(distro, safe=True)
 
     # Update gpg keys from parent repo

Comment 12 Jay Dobies 2012-03-29 13:55:56 UTC
Fixed in 1.0.2-1. Build can be found here:

http://axiom.lab.eng.rdu.redhat.com/pulp/releases/

Comment 13 Preethi Thomas 2012-03-29 15:59:50 UTC
[root@pulp-v1-server ~]# rpm -q pulp
pulp-1.0.2-1.el6.noarch


[root@pulp-v1-server ~]# curl -k -u admin:admin https://localhost/pulp/api/repositories/zoo/packages/|json_reformat |more
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 22166    0 22166    0     0  21422      0 --:--:--  0:00:01 --:--:-- 23681
[
  {
    "license": "GPLv2",
    "_id": "4e3f7ecb-6c96-48ae-b9a1-8ae64027c891",
    "vendor": "",
    "name": "penguin",
    "repo_defined": true,
    "checksum": {
      "sha256": "57d314cc6f5322484cdcd33f4173374de95c53034de5b1168b9291ca0ad06dec"
    },
    "description": "A dummy package of penguin",
    "download_url": "https://pulp-v1-server.usersys.redhat.com//pulp/repos/zoo2/penguin-0.9.1-1.noarch.rpm",
    "buildhost": "smqe-ws15",
    "repoids": [
      "zoo",
      "zoo2",
      "zoo-clone"
    ],


[root@pulp-v1-server ~]# curl -k -u admin:admin https://localhost/pulp/api/repositories/zoo/
"No repository zoo"[root@pulp-v1-server ~]# 

[root@pulp-v1-server ~]# curl -k -u admin:admin https://localhost/pulp/api/repositories/zoo2/packages/|json_reformat |more
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21942  100 21942    0     0  13164      0  0:00:01  0:00:01 --:--:-- 14065
[
  {
    "size": 2464,
    "license": "GPLv2",
    "_id": "4e3f7ecb-6c96-48ae-b9a1-8ae64027c891",
    "vendor": "",
    "name": "penguin",
    "repo_defined": true,
    "checksum": {
      "sha256": "57d314cc6f5322484cdcd33f4173374de95c53034de5b1168b9291ca0ad06de
c"
    },
    "requires": [
      "dolphin"
    ],
    "epoch": "0",
    "download_url": "https://pulp-v1-server.usersys.redhat.com//pulp/repos/zoo2/
penguin-0.9.1-1.noarch.rpm",
    "filename": "penguin-0.9.1-1.noarch.rpm",
    "repoids": [
      "zoo2",
      "zoo-clone"
    ],


[root@pulp-v1-server ~]# curl -k -u admin:admin https://localhost/pulp/api/repositories/zoo2/errata/|json_reformat |more
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
117   586    0   586    0     0    353      0 --:--:--  0:00:01 --:--:--   368
[
  {
    "severity": "",
    "title": "Sea_Erratum",
    "_id": "RHEA-2012:0002",
    "type": "security",
    "id": "RHEA-2012:0002",
    "repoids": [
      "zoo2",
      "zoo-clone"
    ]
  },
  {
    "severity": "",
    "title": "Bird_Erratum",
    "_id": "RHEA-2012:0003",
    "type": "security",
    "id": "RHEA-2012:0003",
    "repoids": [
      "zoo2",
      "zoo-clone"
    ]
  },

[root@pulp-v1-server ~]# pulp-admin repo delete --id=zoo-clone
Repository [ zoo-clone ] being deleted

[root@pulp-v1-server ~]# curl -k -u admin:admin https://localhost/pulp/api/repositories/zoo-clone/
"No repository zoo-clone"curl -k -u admin:admin https://localhost/pulp/api/repositories/zoo2/errata/|json_reformat |more
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
106   534    0   534    0     0    377      0 --:--:--  0:00:01 --:--:--   398
[
  {
    "severity": "",
    "title": "Sea_Erratum",
    "_id": "RHEA-2012:0002",
    "type": "security",
    "id": "RHEA-2012:0002",
    "repoids": [
      "zoo2"
    ]
  },
  {
    "severity": "",
    "title": "Bird_Erratum",
    "_id": "RHEA-2012:0003",
    "type": "security",
    "id": "RHEA-2012:0003",
    "repoids": [
      "zoo2"
    ]
  },
  {
    "severity": "",
--More--

Comment 14 Preethi Thomas 2012-03-29 16:45:55 UTC
Repoid gets removed from distributions.

Distribution--

before deleting f16-clone1

[root@pulp-v1-server ~]# curl -k -u admin:admin  https://localhost/pulp/api/repositories/f16-new/distribution/|json_reformat
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
108  1087    0  1087    0     0    882      0 --:--:--  0:00:01 --:--:-- 1061k
[
  {
    "files": [
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/initrd.img",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/boot.iso",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/efiboot.img",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/repomd.xml",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/.treeinfo",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/vmlinuz",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/efidisk.img"
    ],
    "description": "ks-Fedora-Fedora-16-x86_64",
    "family": "Fedora",
    "url": [
      "http://pulp-v1-server.usersys.redhat.com/pulp/ks/f16-new/",
      "http://pulp-v1-server.usersys.redhat.com/pulp/ks/released/F-16/GOLD/Fedora/x86_64/os/",
      "http://pulp-v1-server.usersys.redhat.com/pulp/ks/f16-clone1/"
    ],
    "relativepath": "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64",
    "variant": "Fedora",
    "id": "ks-Fedora-Fedora-16-x86_64",
    "version": "16",
    "timestamp": "2011-11-02T23:10:12",
    "_id": "ks-Fedora-Fedora-16-x86_64",
    "arch": "x86_64",
    "_ns": "distribution",
    "repoids": [
      "f16-new",
      "f16",
      "f16-clone1"
    ]
  }
]

After deleting f16-clone1

[root@pulp-v1-server ~]# curl -k -u admin:admin  https://localhost/pulp/api/repositories/f16-new/distribution/|json_reformat
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1009    0  1009    0     0   1868      0 --:--:-- --:--:-- --:--:--  2063
[
  {
    "files": [
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/initrd.img",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/boot.iso",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/efiboot.img",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/repomd.xml",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/.treeinfo",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/vmlinuz",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/efidisk.img"
    ],
    "description": "ks-Fedora-Fedora-16-x86_64",
    "family": "Fedora",
    "url": [
      "http://pulp-v1-server.usersys.redhat.com/pulp/ks/f16-new/",
      "http://pulp-v1-server.usersys.redhat.com/pulp/ks/released/F-16/GOLD/Fedora/x86_64/os/"
    ],
    "relativepath": "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64",
    "variant": "Fedora",
    "version": "16",
    "timestamp": "2011-11-02T23:10:12",
    "_ns": "distribution",
    "_id": "ks-Fedora-Fedora-16-x86_64",
    "arch": "x86_64",
    "id": "ks-Fedora-Fedora-16-x86_64",
    "repoids": [
      "f16-new",
      "f16"
    ]
  }
]
[root@pulp-v1-server ~]# 

[root@pulp-v1-server ~]#  pulp-admin repo delete --id=f16-new
Repository [ f16-new ] being deleted

[root@pulp-v1-server ~]# curl -k -u admin:admin https://localhost/pulp/api/repositories/f16-new/|json_reformat 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0    23    0    23    0     0    150      0 --:--:-- --:--:-- --:--:--   225
"No repository f16-new"
[root@pulp-v1-server ~]# 
[root@pulp-v1-server ~]# curl -k -u admin:admin  https://localhost/pulp/api/repositories/f16/distribution/|json_reformat
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
104   937    0   937    0     0   1810      0 --:--:-- --:--:-- --:--:--  2006
[
  {
    "files": [
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/initrd.img",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/boot.iso",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/efiboot.img",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/repomd.xml",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/.treeinfo",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/vmlinuz",
      "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64/efidisk.img"
    ],
    "description": "ks-Fedora-Fedora-16-x86_64",
    "family": "Fedora",
    "url": [
      "http://pulp-v1-server.usersys.redhat.com/pulp/ks/released/F-16/GOLD/Fedora/x86_64/os/"
    ],
    "relativepath": "/var/lib/pulp/distributions/ks-Fedora-Fedora-16-x86_64",
    "variant": "Fedora",
    "id": "ks-Fedora-Fedora-16-x86_64",
    "version": "16",
    "timestamp": "2011-11-02T23:10:12",
    "_id": "ks-Fedora-Fedora-16-x86_64",
    "arch": "x86_64",
    "_ns": "distribution",
    "repoids": [
      "f16"
    ]
  }
]
[root@pulp-v1-server ~]# 


And no repoid in files

[root@pulp-v1-server ~]# curl -k -u admin:admin  https://localhost/pulp/api/repositories/zoo2/files/|json_reformat
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
101   303    0   303    0     0   1621      0 --:--:-- --:--:-- --:--:--  2970
[
  {
    "description": null,
    "repo_defined": false,
    "_ns": "file",
    "download_url": null,
    "filename": "test.txt",
    "checksum": {
      "sha256": "3b9c65088caee457a04d48339eabdb78e5412d3ac45b98b276445df34fd483b8"
    },
    "_id": "55a77aaf-09fe-405e-a7f9-53da2557206a",
    "id": "55a77aaf-09fe-405e-a7f9-53da2557206a",
    "size": 6
  }
]
[root@pulp-v1-server ~]#


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