Project

Profile

Help

Issue #546

closed

Updating a distributors config does not accept null values

Added by jsherril@redhat.com about 7 years ago. Updated almost 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
2.4.1
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Description of problem:

It appears that updating a distributors config does not let you set 'null' values for things that make sense, such as the checksum_type on a yum_distributor. I may want to set it back to the default value, but can't seem to do that.

Version-Release number of selected component (if applicable):
2.4.1

How reproducible:
Always

Steps to Reproduce:
1. Attempt to update a distributor's checksum back to the default value of null

Actual results:
Doesn't get updated

Expected results:
Should be updated

Additional info:
the call in question:
PUT /pulp/api/v2/repositories/Default_Organization-testproduct-sha256/distributors/Default_Organization-testproduct-sha256//

{"distributor_config":{"relative_url":"Default_Organization/Library/custom/testproductsha256","http":true,"https":true,"protected":true,"checksum_type":null}},

+ This bug was cloned from Bugzilla Bug #1146687 +

Actions #1

Updated by mhrivnak about 7 years ago

To rephrase, I think the desire is to unset a value in the config. From pulp's internal perspective, the best behavior would be to remove the key and value from the config object.

+ This comment was cloned from Bugzilla #1146687 comment 1 +

Actions #2

Updated by jcline@redhat.com about 7 years ago

I wasn't able to reproduce this on 2.4.3 or the current 2.6 development branch, but I'm going to put in ON_QA just to make sure.

+ This comment was cloned from Bugzilla #1146687 comment 2 +

Actions #3

Updated by igulina@redhat.com about 7 years ago

Couldn't reproduce it on 2.4.4, 2.5.1 and 2.6

rpm -qa | grep pulp-server

pulp-server-2.6.0-0.1.alpha.fc20.noarch

curl -k -X GET https://user:pass@host/pulp/api/v2/repositories/my_repo/distributors/ | python -m json.tool % Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed
100 678 100 678 0 0 1719 0 --:--:-- --:--:-- --:--:-- 1720
[
{
"_id": {
"$oid": "54898d2799cca8476f397d5b"
},
"_ns": "repo_distributors",
"auto_publish": true,
"config": {
"checksum_type": "sha",
"http": true,
"https": true,
"protected": true,
"relative_url": "my_updated_repo"
},
"distributor_type_id": "yum_distributor",
"id": "yum_distributor",
"last_publish": null,
"repo_id": "my_repo",
"scheduled_publishes": [],
"scratchpad": null
},
{
"_id": {
"$oid": "54898d2799cca8476f397d5c"
},
"_ns": "repo_distributors",
"auto_publish": false,
"config": {
"http": false,
"https": true
},
"distributor_type_id": "export_distributor",
"id": "export_distributor",
"last_publish": null,
"repo_id": "my_repo",
"scheduled_publishes": [],
"scratchpad": null
}
]

curl -i -H "Accept: application/json" -X PUT -k https://user:pass@host/pulp/api/v2/repositories/my_repo/distributors/yum_distributor/ --data '{"distributor_config":{"relative_url":"my_updated_repo","http":true,"https":true,"protected":true,"checksum_type": null}}'

HTTP/1.1 202 Accepted
Date: Thu, 11 Dec 2014 13:11:31 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 172
Content-Type: application/json

{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/43ecefe5-1dbc-4080-9dc4-0c7ede5720d5/", "task_id": "43ecefe5-1dbc-4080-9dc4-0c7ede5720d5"}], "result": null, "error": null}

curl -k -X GET https://user:pass@host/pulp/api/v2/repositories/my_repo/distributors/ | python -m json.tool % Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed
100 654 100 654 0 0 1931 0 --:--:-- --:--:-- --:--:-- 1929
[
{
"_id": {
"$oid": "54898d2799cca8476f397d5b"
},
"_ns": "repo_distributors",
"auto_publish": true,
"config": {
"http": true,
"https": true,
"protected": true,
"relative_url": "my_updated_repo"
},
"distributor_type_id": "yum_distributor",
"id": "yum_distributor",
"last_publish": null,
"repo_id": "my_repo",
"scheduled_publishes": [],
"scratchpad": null
},
{
"_id": {
"$oid": "54898d2799cca8476f397d5c"
},
"_ns": "repo_distributors",
"auto_publish": false,
"config": {
"http": false,
"https": true
},
"distributor_type_id": "export_distributor",
"id": "export_distributor",
"last_publish": null,
"repo_id": "my_repo",
"scheduled_publishes": [],
"scratchpad": null
}
]


rpm -qa | grep pulp-server

pulp-server-2.5.1-0.1.beta.el6.noarch

curl -k -X GET https://user:pass@host/pulp/api/v2/repositories/kik-repo/distributors/ | python -m json.tool

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
115 691 115 691 0 0 2138 0 --:--:-- --:--:-- --:--:-- 4213
[
{
"_id": {
"$oid": "5488787dcf3e2224f90b7eba"
},
"_ns": "repo_distributors",
"auto_publish": true,
"config": {
"checksum_type": "sha",
"http": true,
"https": true,
"protected": true,
"relative_url": "kik-repo"
},
"distributor_type_id": "yum_distributor",
"id": "yum_distributor",
"last_publish": "2014-12-10T16:54:34Z",
"repo_id": "kik-repo",
"scheduled_publishes": [],
"scratchpad": null
},
{
"_id": {
"$oid": "5488787dcf3e2224f90b7ebb"
},
"_ns": "repo_distributors",
"auto_publish": false,
"config": {
"http": false,
"https": true
},
"distributor_type_id": "export_distributor",
"id": "export_distributor",
"last_publish": null,
"repo_id": "kik-repo",
"scheduled_publishes": [],
"scratchpad": null
}
]

curl -i -H "Accept: application/json" -X PUT -k https://user:pass@host/pulp/api/v2/repositories/kik-repo/distributors/yum_distributor/ --data '{"distributor_config":{"relative_url":"kik-repo","http":true,"https":true,"protected":true,"checksum_type": null}}'

HTTP/1.1 202 Accepted
Date: Thu, 11 Dec 2014 13:26:23 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Encoding: utf-8
Content-Length: 172
Connection: close
Content-Type: application/json

{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/770f71ec-4fd7-46aa-ad9e-8f71363f0ade/", "task_id": "770f71ec-4fd7-46aa-ad9e-8f71363f0ade"}], "result": null, "error": null}

curl -k -X GET https://user:pass@host/pulp/api/v2/repositories/kik-repo/distributors/ | python -m json.tool

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
111 667 111 667 0 0 2503 0 --:--:-- --:--:-- --:--:-- 4042
[
{
"_id": {
"$oid": "5488787dcf3e2224f90b7eba"
},
"_ns": "repo_distributors",
"auto_publish": true,
"config": {
"http": true,
"https": true,
"protected": true,
"relative_url": "kik-repo"
},
"distributor_type_id": "yum_distributor",
"id": "yum_distributor",
"last_publish": "2014-12-10T16:54:34Z",
"repo_id": "kik-repo",
"scheduled_publishes": [],
"scratchpad": null
},
{
"_id": {
"$oid": "5488787dcf3e2224f90b7ebb"
},
"_ns": "repo_distributors",
"auto_publish": false,
"config": {
"http": false,
"https": true
},
"distributor_type_id": "export_distributor",
"id": "export_distributor",
"last_publish": null,
"repo_id": "kik-repo",
"scheduled_publishes": [],
"scratchpad": null
}
]


rpm -qa | grep pulp-server

pulp-server-2.4.4-0.1.beta.el7.noarch

curl -k -X GET https://user:pass@host/pulp/api/v2/repositories/sha-yum/distributors/ | python -m json.tool

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 678 100 678 0 0 1418 0 --:--:-- --:--:-- --:--:-- 1418
[
{
"_id": {
"$oid": "5485d22821ede1283eb23631"
},
"_ns": "repo_distributors",
"auto_publish": true,
"config": {
"checksum_type": "sha256",
"http": false,
"https": true,
"relative_url": "sha-yum"
},
"distributor_type_id": "yum_distributor",
"id": "yum_distributor",
"last_publish": "2014-12-08T11:32:28-05:00",
"repo_id": "sha-yum",
"scheduled_publishes": [],
"scratchpad": null
},
{
"_id": {
"$oid": "5485d22821ede1283eb23632"
},
"_ns": "repo_distributors",
"auto_publish": false,
"config": {
"http": false,
"https": true
},
"distributor_type_id": "export_distributor",
"id": "export_distributor",
"last_publish": null,
"repo_id": "sha-yum",
"scheduled_publishes": [],
"scratchpad": null
}
]

curl -i -H "Accept: application/json" -X PUT -k https://user:pass@host/pulp/api/v2/repositories/sha-yum/distributors/yum_distributor/ --data '{"distributor_config":{"relative_url":"sha-yum","http":true,"https":true,"protected":true,"checksum_type": null}}'

HTTP/1.1 202 Accepted
Date: Thu, 11 Dec 2014 13:31:49 GMT
Server: Apache/2.4.6 (Red Hat) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 172
Content-Type: application/json

{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/53a160f3-f579-49bb-b7a4-e85549f0601d/", "task_id": "53a160f3-f579-49bb-b7a4-e85549f0601d"}], "result": null, "error": null}

curl -k -X GET https://user:pass@host/pulp/api/v2/repositories/sha-yum/distributors/ | python -m json.tool % Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed
100 669 100 669 0 0 1442 0 --:--:-- --:--:-- --:--:-- 1444
[
{
"_id": {
"$oid": "5485d22821ede1283eb23631"
},
"_ns": "repo_distributors",
"auto_publish": true,
"config": {
"http": true,
"https": true,
"protected": true,
"relative_url": "sha-yum"
},
"distributor_type_id": "yum_distributor",
"id": "yum_distributor",
"last_publish": "2014-12-08T11:32:28-05:00",
"repo_id": "sha-yum",
"scheduled_publishes": [],
"scratchpad": null
},
{
"_id": {
"$oid": "5485d22821ede1283eb23632"
},
"_ns": "repo_distributors",
"auto_publish": false,
"config": {
"http": false,
"https": true
},
"distributor_type_id": "export_distributor",
"id": "export_distributor",
"last_publish": null,
"repo_id": "sha-yum",
"scheduled_publishes": [],
"scratchpad": null
}
]

+ This comment was cloned from Bugzilla #1146687 comment 3 +

Actions #4

Updated by bmbouter about 7 years ago

  • Severity changed from High to 3. High
Actions #5

Updated by dkliban@redhat.com over 6 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #7

Updated by bmbouter about 3 years ago

  • Tags Pulp 2 added
Actions #8

Updated by bmbouter almost 2 years ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Also available in: Atom PDF