Actions
Issue #1237
closedPuppet Install Distributor does not raise exception when non-optional install_path is missing
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Platform Release:
2.13.2
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Quarter:
Description
I was able to create a distributor without the required field 'distributor_config'. The documentation says it's required because it's not optional. I expect it is required because when you publish a distributor whose config is None you'll probably get an exception, so by not requiring it the user can get into a bad state.
To reproduce I did the following:
1. Create a repo named zoo-puppet
2. use httpie to create the distributor without its config by running the following:
http --json --verify no --auth admin:admin POST https://localhost/pulp/api/v2/repositories/zoo-puppet/distributors/ distributor_type_id=puppet_install_distributor
3. Now observe its output:
HTTP/1.1 201 CREATED
Connection: Keep-Alive
Content-Length: 405
Content-Type: application/json; charset=utf-8
Date: Fri, 04 Sep 2015 19:30:39 GMT
Keep-Alive: timeout=5, max=100
Location: https://localhost/pulp/api/v2/repositories/zoo-puppet/distributors/27484a4e-afd7-4cbd-ace0-fa18979ab406/
Server: Apache/2.4.16 (Fedora) OpenSSL/1.0.1k-fips PHP/5.6.12 mod_wsgi/4.4.8 Python/2.7.10
{
"_href": "/pulp/api/v2/repositories/zoo-puppet/distributors/27484a4e-afd7-4cbd-ace0-fa18979ab406/",
"_id": {
"$oid": "55e9f160549034239f55e877"
},
"_ns": "repo_distributors",
"auto_publish": false,
"config": null,
"distributor_type_id": "puppet_install_distributor",
"id": "27484a4e-afd7-4cbd-ace0-fa18979ab406",
"last_publish": null,
"repo_id": "zoo-puppet",
"scheduled_publishes": [],
"scratchpad": null
}
4. Notice the "config: null" part which will likely cause problems at publish time.
I expected a 400 response, but instead I received a 201.
Actions
Update Puppet module install_distributor
Config validation was returning True instead of False when a distributor_config was not specified while associating a distributor to a repository.
closes #1237 https://pulp.plan.io/issues/1237