Actions
Issue #1101
closedIf feed is not specified during repo creation it should not be present in importer_config post data
Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version - OSTree:
master
Platform Release:
Target Release - OSTree:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:
Description
There is a default value for feed(null) when you create the ostree repo. If a repo is created with no feed the key 'feed' should not be present in the importer config. Over wise it could lead to:
$ pulp-admin -vv ostree repo create --repo-id test-repo
2015-07-02 16:40:14,222 - DEBUG - sending POST request to /pulp/api/v2/repositories/
2015-07-02 16:40:14,342 - INFO - POST request to /pulp/api/v2/repositories/ with parameters {"display_name": null, "description": null, "distributors": [{"distributor_id": "ostree_web_distributor_name_cli", "auto_publish": null, "distributor_config": {"relative_path": null}, "distributor_type_id": "ostree_web_distributor"}], "notes": {"_repo-type": "OSTREE"}, "importer_type_id": "ostree_web_importer", "importer_config": {"feed": null, "validate": null}, "id": "test-repo"}
2015-07-02 16:40:14,342 - INFO - Response status : 201
2015-07-02 16:40:14,342 - INFO - Response body :
{
"scratchpad": {},
"display_name": "test-repo",
"description": null,
"last_unit_added": null,
"notes": {
"_repo-type": "OSTREE"
},
"last_unit_removed": null,
"content_unit_counts": {},
"_ns": "repos",
"_id": {
"$oid": "55954d4e45ef48222b7bd21b"
},
"id": "test-repo",
"_href": "/pulp/api/v2/repositories/test-repo/"
}
Repository [test-repo] successfully created
$ pulp-admin -vv ostree repo sync run --repo-id test-repo
+----------------------------------------------------------------------+
Synchronizing Repository [test-repo]
+----------------------------------------------------------------------+
2015-07-02 16:46:35,185 - DEBUG - sending POST request to /pulp/api/v2/tasks/search/
2015-07-02 16:46:35,300 - INFO - POST request to /pulp/api/v2/tasks/search/ with parameters {"criteria": {"filters": {"state": {"$nin": ["finished", "error", "canceled", "skipped"]}, "tags": {"$all": ["pulp:repository:test-repo", "pulp:action:sync"]}}}}
2015-07-02 16:46:35,300 - INFO - Response status : 200
2015-07-02 16:46:35,300 - INFO - Response body :
[]
2015-07-02 16:46:35,300 - DEBUG - sending POST request to /pulp/api/v2/repositories/test-repo/actions/sync/
2015-07-02 16:46:35,457 - INFO - POST request to /pulp/api/v2/repositories/test-repo/actions/sync/ with parameters {"override_config": null}
2015-07-02 16:46:35,457 - INFO - Response status : 202
2015-07-02 16:46:35,458 - INFO - Response body :
{
"spawned_tasks": [
{
"_href": "/pulp/api/v2/tasks/446c66cd-6ab1-41b8-acdf-bbcbad13d462/",
"task_id": "446c66cd-6ab1-41b8-acdf-bbcbad13d462"
}
],
"result": null,
"error": null
}
This command may be exited via ctrl+c without affecting the request.
2015-07-02 16:46:36,459 - DEBUG - sending GET request to /pulp/api/v2/tasks/446c66cd-6ab1-41b8-acdf-bbcbad13d462/
2015-07-02 16:46:36,582 - INFO - GET request to /pulp/api/v2/tasks/446c66cd-6ab1-41b8-acdf-bbcbad13d462/ with parameters None
2015-07-02 16:46:36,582 - INFO - Response status : 200
2015-07-02 16:46:36,583 - INFO - Response body :
{
"exception": null,
"task_type": "pulp.server.managers.repo.sync.sync",
"_href": "/pulp/api/v2/tasks/446c66cd-6ab1-41b8-acdf-bbcbad13d462/",
"task_id": "446c66cd-6ab1-41b8-acdf-bbcbad13d462",
"tags": [
"pulp:repository:test-repo",
"pulp:action:sync"
],
"finish_time": "2015-07-02T14:46:35Z",
"_ns": "task_status",
"start_time": "2015-07-02T14:46:35Z",
"traceback": "Traceback (most recent call last):\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File \"/home/ipanova/pulp_development/pulp/server/pulp/server/async/tasks.py\", line 393, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 437, in __protected_call__\n return self.run(*args, **kwargs)\n File \"/home/ipanova/pulp_development/pulp/server/pulp/server/managers/repo/sync.py\", line 93, in sync\n call_config)\n File \"/home/ipanova/pulp_development/pulp/server/pulp/server/managers/repo/sync.py\", line 147, in _do_sync\n sync_report = sync_repo(transfer_repo, conduit, call_config)\n File \"/home/ipanova/pulp_development/pulp/server/pulp/server/async/tasks.py\", line 558, in wrap_f\n return f(*args, **kwargs)\n File \"/home/ipanova/pulp_development/pulp_ostree/plugins/pulp_ostree/plugins/importers/web.py\", line 90, in sync_repo\n step = Main(repo=repo, conduit=conduit, config=config)\n File \"/home/ipanova/pulp_development/pulp_ostree/plugins/pulp_ostree/plugins/importers/steps.py\", line 34, in __init__\n self.remote_id = model.generate_remote_id(self.feed_url)\n File \"/home/ipanova/pulp_development/pulp_ostree/common/pulp_ostree/common/model.py\", line 25, in generate_remote_id\n h.update(url)\nTypeError: must be string or buffer, not None\n",
"spawned_tasks": [],
"progress_report": {},
"queue": "reserved_resource_worker-1@ina.usersys.redhat.com.dq",
"state": "error",
"worker_name": "reserved_resource_worker-1@ina.usersys.redhat.com",
"result": null,
"error": {
"code": "PLP0000",
"data": {},
"description": "must be string or buffer, not None",
"sub_errors": []
},
"_id": {
"$oid": "55954ecb3d050b32b4a980f2"
},
"id": "55954ecb3d050b32b4a980f2"
}
Task Failed
must be string or buffer, not None
Instead it should raise an error that it is impossible to sync repo without feed.
$ pulp-admin -vv rpm repo create --repo-id test-repo1
2015-07-02 16:53:51,548 - DEBUG - sending POST request to /pulp/api/v2/repositories/
2015-07-02 16:53:51,682 - INFO - POST request to /pulp/api/v2/repositories/ with parameters {"display_name": null, "description": null, "distributors": [{"distributor_id": "yum_distributor", "auto_publish": true, "distributor_config": {"http": false, "relative_url": "test-repo1", "https": true}, "distributor_type_id": "yum_distributor"}, {"distributor_id": "export_distributor", "auto_publish": false, "distributor_config": {"http": false, "https": true}, "distributor_type_id": "export_distributor"}], "notes": {"_repo-type": "rpm-repo"}, "importer_type_id": "yum_importer", "importer_config": {}, "id": "test-repo1"}
2015-07-02 16:53:51,682 - INFO - Response status : 201
2015-07-02 16:53:51,682 - INFO - Response body :
{
"scratchpad": {},
"display_name": "test-repo1",
"description": null,
"last_unit_added": null,
"notes": {
"_repo-type": "rpm-repo"
},
"last_unit_removed": null,
"content_unit_counts": {},
"_ns": "repos",
"_id": {
"$oid": "5595507f45ef48222a195470"
},
"id": "test-repo1",
"_href": "/pulp/api/v2/repositories/test-repo1/"
}
Successfully created repository [test-repo1]
[ipanova@ina home]$ pulp-admin -vv rpm repo sync run --repo-id test-repo1
+----------------------------------------------------------------------+
Synchronizing Repository [test-repo1]
+----------------------------------------------------------------------+
2015-07-02 16:54:02,473 - DEBUG - sending POST request to /pulp/api/v2/tasks/search/
2015-07-02 16:54:02,618 - INFO - POST request to /pulp/api/v2/tasks/search/ with parameters {"criteria": {"filters": {"state": {"$nin": ["finished", "error", "canceled", "skipped"]}, "tags": {"$all": ["pulp:repository:test-repo1", "pulp:action:sync"]}}}}
2015-07-02 16:54:02,618 - INFO - Response status : 200
2015-07-02 16:54:02,618 - INFO - Response body :
[]
2015-07-02 16:54:02,619 - DEBUG - sending POST request to /pulp/api/v2/repositories/test-repo1/actions/sync/
2015-07-02 16:54:02,749 - INFO - POST request to /pulp/api/v2/repositories/test-repo1/actions/sync/ with parameters {"override_config": null}
2015-07-02 16:54:02,749 - INFO - Response status : 202
2015-07-02 16:54:02,749 - INFO - Response body :
{
"spawned_tasks": [
{
"_href": "/pulp/api/v2/tasks/5eff8096-9b3f-4f00-8703-ddde20d3f0c3/",
"task_id": "5eff8096-9b3f-4f00-8703-ddde20d3f0c3"
}
],
"result": null,
"error": null
}
This command may be exited via ctrl+c without affecting the request.
2015-07-02 16:54:03,751 - DEBUG - sending GET request to /pulp/api/v2/tasks/5eff8096-9b3f-4f00-8703-ddde20d3f0c3/
2015-07-02 16:54:03,868 - INFO - GET request to /pulp/api/v2/tasks/5eff8096-9b3f-4f00-8703-ddde20d3f0c3/ with parameters None
2015-07-02 16:54:03,868 - INFO - Response status : 200
2015-07-02 16:54:03,868 - INFO - Response body :
{
"exception": null,
"task_type": "pulp.server.managers.repo.sync.sync",
"_href": "/pulp/api/v2/tasks/5eff8096-9b3f-4f00-8703-ddde20d3f0c3/",
"task_id": "5eff8096-9b3f-4f00-8703-ddde20d3f0c3",
"tags": [
"pulp:repository:test-repo1",
"pulp:action:sync"
],
"finish_time": "2015-07-02T14:54:02Z",
"_ns": "task_status",
"start_time": "2015-07-02T14:54:02Z",
"traceback": "Traceback (most recent call last):\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 240, in trace_task\n R = retval = fun(*args, **kwargs)\n File \"/home/ipanova/pulp_development/pulp/server/pulp/server/async/tasks.py\", line 393, in __call__\n return super(Task, self).__call__(*args, **kwargs)\n File \"/usr/lib/python2.7/site-packages/celery/app/trace.py\", line 437, in __protected_call__\n return self.run(*args, **kwargs)\n File \"/home/ipanova/pulp_development/pulp/server/pulp/server/managers/repo/sync.py\", line 93, in sync\n call_config)\n File \"/home/ipanova/pulp_development/pulp/server/pulp/server/managers/repo/sync.py\", line 147, in _do_sync\n sync_report = sync_repo(transfer_repo, conduit, call_config)\n File \"/home/ipanova/pulp_development/pulp/server/pulp/server/async/tasks.py\", line 558, in wrap_f\n return f(*args, **kwargs)\n File \"/home/ipanova/pulp_development/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/importer.py\", line 66, in sync_repo\n report = self._current_sync.run()\n File \"/home/ipanova/pulp_development/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/sync.py\", line 184, in run\n raise PulpCodedException(error_code=error_codes.RPM1005)\nPulpCodedException: Unable to sync a repository that has no feed.\n",
"spawned_tasks": [],
"progress_report": {
"yum_importer": {
"content": {
"size_total": 0,
"items_left": 0,
"items_total": 0,
"state": "NOT_STARTED",
"size_left": 0,
"details": {
"rpm_total": 0,
"rpm_done": 0,
"drpm_total": 0,
"drpm_done": 0
},
"error_details": []
},
"comps": {
"state": "NOT_STARTED"
},
"distribution": {
"items_total": 0,
"state": "NOT_STARTED",
"error_details": [],
"items_left": 0
},
"errata": {
"state": "NOT_STARTED"
},
"metadata": {
"state": "NOT_STARTED"
}
}
},
"queue": "reserved_resource_worker-1@ina.usersys.redhat.com.dq",
"state": "error",
"worker_name": "reserved_resource_worker-1@ina.usersys.redhat.com",
"result": null,
"error": {
"code": "RPM1005",
"data": {},
"description": "Unable to sync a repository that has no feed.",
"sub_errors": []
},
"_id": {
"$oid": "5595508a3d050b32b4a980f3"
},
"id": "5595508a3d050b32b4a980f3"
}
Task Failed
Unable to sync a repository that has no feed.
Actions