Project

Profile

Help

Issue #1237

closed

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

Added by bmbouter over 8 years ago. Updated about 5 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.

Actions #1

Updated by mhrivnak over 8 years ago

  • Triaged changed from No to Yes
  • Tags Easy Fix added
Actions #2

Updated by mansari almost 7 years ago

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

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

Issue with install_distributor

Actions #3

Updated by bizhang almost 7 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

Added by mansari almost 7 years ago

Revision 34e1d5bd | View on GitHub

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

Actions #4

Updated by mansari almost 7 years ago

  • Status changed from POST to MODIFIED

Added by mansari almost 7 years ago

Revision 0016a355 | View on GitHub

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

Actions #5

Updated by mansari almost 7 years ago

Actions #6

Updated by pcreech almost 7 years ago

  • Platform Release set to 2.13.2
Actions #7

Updated by pcreech almost 7 years ago

  • Status changed from MODIFIED to 5
Actions #9

Updated by pcreech almost 7 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #10

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF