Project

Profile

Help

Issue #1237

Puppet Install Distributor does not raise exception when non-optional install_path is missing

Added by bmbouter about 6 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
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.

Associated revisions

Revision 34e1d5bd View on GitHub
Added by mansari over 4 years ago

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

Revision 0016a355 View on GitHub
Added by mansari over 4 years ago

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

History

#1 Updated by mhrivnak about 6 years ago

  • Triaged changed from No to Yes
  • Tags Easy Fix added

#2 Updated by mansari over 4 years ago

  • Status changed from NEW to POST
  • Assignee set to mansari

https://github.com/pulp/pulp_puppet/pull/262

Issue with install_distributor

#3 Updated by bizhang over 4 years ago

  • Project changed from Pulp to Puppet Support
  • Subject changed from Distributor field 'distributor_config' shown as non-optional but no exception is raised if it is missing to Puppet Install Distributor does not raise exception when non-optional install_path is missing

#4 Updated by mansari over 4 years ago

  • Status changed from POST to MODIFIED

#5 Updated by mansari over 4 years ago

#6 Updated by pcreech over 4 years ago

  • Platform Release set to 2.13.2

#7 Updated by pcreech over 4 years ago

  • Status changed from MODIFIED to 5

#9 Updated by pcreech over 4 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

#10 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF