Project

Profile

Help

Issue #2030

closed

importer config is not validated during the update

Added by ipanova@redhat.com almost 8 years ago. Updated almost 4 years ago.

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

Description

Importer config is validated during the creation but not during the update call.

$ curl -i -H "Accept: application/json" -X PUT -k -u admin:admin -d '{"importer_config":{"download_policy":"nonsense" }}' 'https://localhost/pulp/api/v2/repositories/123456/importers/yum_importer/'
HTTP/1.1 202 ACCEPTED
Date: Wed, 22 Jun 2016 15:18:15 GMT
Server: Apache/2.4.16 (Fedora) OpenSSL/1.0.1k-fips mod_wsgi/4.4.1 Python/2.7.8
Content-Length: 172
Content-Type: application/json; charset=utf-8

{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/4b4df091-36c9-439f-951e-07196e10f476/", "task_id": "4b4df091-36c9-439f-951e-07196e10f476"}], "result": null, "error": null}[ipanova@ina pulp_rpm]$ 
[ipanova@ina pulp_rpm]$ 
[ipanova@ina pulp_rpm]$ pulp-admin tasks details --task-id 4b4df091-36c9-439f-951e-07196e10f476
Warning: path should have mode 0700 because it may contain sensitive information: /home/ipanova/.pulp/

+----------------------------------------------------------------------+
                              Task Details
+----------------------------------------------------------------------+

Operations:       update_importer
Resources:        123456 (repository), yum_importer (repository_importer)
State:            Successful
Start Time:       2016-06-22T15:18:16Z
Finish Time:      2016-06-22T15:18:16Z
Result:           
  Config:           
    Download Policy: nonsense
  Id:               yum_importer
  Importer Type Id: yum_importer
  Last Sync:        None
  Repo Id:          123456
  Scratchpad:       None
Task Id:          4b4df091-36c9-439f-951e-07196e10f476
Progress Report:  

[ipanova@ina pulp_rpm]$ curl -H "Accept: application/json" -X GET -k -u admin:admin 'https://localhost/pulp/api/v2/repositories/123456/importers/yum_importer/'| python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   328  100   328    0     0   1203      0 --:--:-- --:--:-- --:--:--  1201
{
    "_href": "/pulp/api/v2/repositories/123456/importers/yum_importer/",
    "_id": {
        "$oid": "576a917645ef486cf3e61650"
    },
    "_ns": "repo_importers",
    "config": {

        "download_policy": "nonsense"
    },
    "id": "yum_importer",
    "importer_type_id": "yum_importer",
    "last_sync": null,
    "repo_id": "123456",
    "scratchpad": null
}

Related issues

Blocks RPM Support - Story #1991: As a user, uploaded units which don't pass the signature check are not importedCLOSED - CURRENTRELEASEipanova@redhat.com

Actions
Actions #1

Updated by ipanova@redhat.com almost 8 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ipanova@redhat.com

Added by ipanova@redhat.com almost 8 years ago

Revision bf5057bc | View on GitHub

Importer config is not validated during the update.

closes #2030 https://pulp.plan.io/issues/2030

Added by ipanova@redhat.com almost 8 years ago

Revision bf5057bc | View on GitHub

Importer config is not validated during the update.

closes #2030 https://pulp.plan.io/issues/2030

Actions #2

Updated by ipanova@redhat.com almost 8 years ago

  • Status changed from ASSIGNED to POST
  • Sprint/Milestone set to 22
Actions #3

Updated by ipanova@redhat.com almost 8 years ago

  • Platform Release set to 2.10.0
Actions #4

Updated by ipanova@redhat.com almost 8 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #5

Updated by amacdona@redhat.com almost 8 years ago

  • Triaged changed from No to Yes
Actions #6

Updated by ipanova@redhat.com almost 8 years ago

  • Blocks Story #1991: As a user, uploaded units which don't pass the signature check are not imported added
Actions #7

Updated by semyers almost 8 years ago

  • Status changed from MODIFIED to 5
Actions #8

Updated by pthomas@redhat.com almost 8 years ago

  • Status changed from 5 to 6

verified

[root@cloud-qe-05 ~]# rpm -qa | sort | grep -i pulp
pulp-admin-client-2.10.0-0.4.beta.el7.noarch
pulp-docker-admin-extensions-2.1.0-0.2.beta.el7.noarch
pulp-docker-plugins-2.1.0-0.2.beta.el7.noarch
pulp-ostree-admin-extensions-1.1.3-1.el7.noarch
pulp-ostree-plugins-1.1.3-1.el7.noarch
pulp-puppet-admin-extensions-2.10.0-0.1.beta.el7.noarch
pulp-puppet-plugins-2.10.0-0.1.beta.el7.noarch
pulp-python-admin-extensions-1.1.3-1.el7.noarch
pulp-python-plugins-1.1.3-1.el7.noarch
pulp-rpm-admin-extensions-2.10.0-0.4.beta.el7.noarch
pulp-rpm-plugins-2.10.0-0.4.beta.el7.noarch
pulp-selinux-2.10.0-0.4.beta.el7.noarch
pulp-server-2.10.0-0.4.beta.el7.noarch
python-isodate-0.5.0-4.pulp.el7.noarch
python-kombu-3.0.33-6.pulp.el7.noarch
python-pulp-bindings-2.10.0-0.4.beta.el7.noarch
python-pulp-client-lib-2.10.0-0.4.beta.el7.noarch
python-pulp-common-2.10.0-0.4.beta.el7.noarch
python-pulp-docker-common-2.1.0-0.2.beta.el7.noarch
python-pulp-oid_validation-2.10.0-0.4.beta.el7.noarch
python-pulp-ostree-common-1.1.3-1.el7.noarch
python-pulp-puppet-common-2.10.0-0.1.beta.el7.noarch
python-pulp-python-common-1.1.3-1.el7.noarch
python-pulp-repoauth-2.10.0-0.4.beta.el7.noarch
python-pulp-rpm-common-2.10.0-0.4.beta.el7.noarch
python-pulp-streamer-2.10.0-0.4.beta.el7.noarch
[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# 

[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# pulp-admin rpm repo create --repo-id 123456
The specified user does not have permission to execute the given command

[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# pulp-admin login -u admin -p admin
Successfully logged in. Session certificate will expire at Sep  6 16:29:28 2016
GMT.

[root@cloud-qe-05 ~]# pulp-admin rpm repo create --repo-id 123456
Successfully created repository [123456]

[root@cloud-qe-05 ~]# curl -i -H "Accept: application/json" -X PUT -k -u admin:admin -d '{"importer_config":{"download_policy":"nonsense" }}' 'https://localhost/pulp/api/v2/repositories/123456/importers/yum_importer/'
HTTP/1.1 202 ACCEPTED
Date: Tue, 30 Aug 2016 16:29:57 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 172
Content-Type: application/json; charset=utf-8

{"spawned_tasks": [{"_href": "/pulp/api/v2/tasks/fc4ad9de-c7bc-43b0-9834-c2948aedd593/", "task_id": "fc4ad9de-c7bc-43b0-9834-c2948aedd593"}], "result": null, "error": null}[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# pulp-amin tasks details --task-id fc4ad9de-c7bc-43b0-9834-c2948aedd593
-bash: pulp-amin: command not found
[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# 
[root@cloud-qe-05 ~]# pulp-admin tasks details --task-id fc4ad9de-c7bc-43b0-9834-c2948aedd593
+----------------------------------------------------------------------+
                              Task Details
+----------------------------------------------------------------------+

Operations:       update_importer
Resources:        123456 (repository), yum_importer (repository_importer)
State:            Failed
Start Time:       2016-08-30T16:29:57Z
Finish Time:      2016-08-30T16:29:57Z
Result:           N/A
Task Id:          fc4ad9de-c7bc-43b0-9834-c2948aedd593
Progress Report:  
Traceback:        Traceback (most recent call last):   File
                  "/usr/lib/python2.7/site-packages/celery/app/trace.py", line
                  240, in trace_task     R = retval = fun(*args, **kwargs)  
                  File
                  "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py",
                  line 488, in __call__     return super(Task,
                  self).__call__(*args, **kwargs)   File
                  "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py",
                  line 103, in __call__     return super(PulpTask,
                  self).__call__(*args, **kwargs)   File
                  "/usr/lib/python2.7/site-packages/celery/app/trace.py", line
                  437, in __protected_call__     return self.run(*args,
                  **kwargs)   File
                  "/usr/lib/python2.7/site-packages/pulp/server/controllers/impo
                  rter.py", line 256, in update_importer_config    
                  validate_importer_config(repo_obj,
                  repo_importer.importer_type_id, repo_importer.config)   File
                  "/usr/lib/python2.7/site-packages/pulp/server/controllers/impo
                  rter.py", line 161, in validate_importer_config     raise
                  exceptions.PulpDataException(message) PulpDataException:
                  Configuration errors: download_policy must be: ['immediate',
                  'background', 'on_demand'] 

[root@cloud-qe-05 ~]# curl -H "Accept: application/json" -X GET -k -u admin:admin 'https://localhost/pulp/api/v2/repositories/123456/importers/yum_importer/'| python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   271  100   271    0     0   1378      0 --:--:-- --:--:-- --:--:--  1375
{
    "_href": "/pulp/api/v2/repositories/123456/importers/yum_importer/",
    "_id": {
        "$oid": "57c5b46a12783b7a32ebf207"
    },
    "_ns": "repo_importers",
    "config": {},
    "id": "yum_importer",
    "importer_type_id": "yum_importer",
    "last_sync": null,
    "repo_id": "123456",
    "scratchpad": null
}
[root@cloud-qe-05 ~]# 
Actions #9

Updated by semyers over 7 years ago

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

Updated by bmbouter over 6 years ago

  • Sprint set to Sprint 4
Actions #12

Updated by bmbouter over 6 years ago

  • Sprint/Milestone deleted (22)
Actions #13

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added
Actions #14

Updated by bmbouter almost 4 years ago

  • Category deleted (14)

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

Also available in: Atom PDF