Project

Profile

Help

Issue #1881

pulp-admin fails to display the erratum if not all metadata is present

Added by ttereshc over 5 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.9.3
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Follow the docs to upload the erratum.
Try to display it.

$ pulp-admin -vv  rpm repo content errata --repo-id=your_repo --erratum-id DEMO_ID_1
2016-04-29 21:15:40,503 - DEBUG - sending POST request to /pulp/api/v2/repositories/your_repo/search/units/
2016-04-29 21:15:40,531 - INFO - POST request to /pulp/api/v2/repositories/your_rep/search/units/ with parameters {"criteria": {"type_ids": ["erratum"], "filters": {"unit": {"id": "DEMO_ID_1"}}}}
2016-04-29 21:15:40,531 - INFO - Response status : 200 
...

+----------------------------------------------------------------------+
                           Erratum: DEMO_ID_1
+----------------------------------------------------------------------+

2016-04-29 21:15:40,532 - ERROR - Client-side exception occurred
Traceback (most recent call last):
  File "/home/user1/devel/pulp/client_lib/pulp/client/extensions/core.py", line 474, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.7/site-packages/okaara/cli.py", line 974, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/home/user1/devel/pulp/client_lib/pulp/client/extensions/extensions.py", line 210, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/home/user1/devel/pulp_rpm/extensions_admin/pulp_rpm/extensions/admin/contents.py", line 413, in errata
    self.run_search([TYPE_ERRATUM], self.write_erratum_detail, **new_kwargs)
  File "/home/user1/devel/pulp_rpm/extensions_admin/pulp_rpm/extensions/admin/contents.py", line 169, in run_search
    out_func(units, FIELDS_BY_TYPE[type_ids[0]])
  File "/home/user1/devel/pulp_rpm/extensions_admin/pulp_rpm/extensions/admin/contents.py", line 477, in write_erratum_detail
    'summary': erratum_meta['summary'],
KeyError: 'summary'
An unexpected error has occurred. More information may be found using the -v flag.

According to the same docs at some point it worked and you could see None in the output:

Rights:           None
Severity:         None
Solution:         None
Status:           final
Summary:          None

Associated revisions

Revision ac63735c View on GitHub
Added by fdobrovo over 5 years ago

Fix pulp-admin error with errata display if metadata missing

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

History

#1 Updated by dkliban@redhat.com over 5 years ago

  • Priority changed from Normal to High
  • Platform Release set to 2.8.4
  • Triaged changed from No to Yes

#2 Updated by semyers over 5 years ago

  • Platform Release changed from 2.8.4 to 2.8.5

#3 Updated by ttereshc over 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ttereshc

#4 Updated by semyers over 5 years ago

  • Platform Release changed from 2.8.5 to 2.8.6

#5 Updated by ttereshc over 5 years ago

  • Status changed from ASSIGNED to NEW
  • Assignee deleted (ttereshc)
  • Platform Release deleted (2.8.6)

#6 Updated by fdobrovo over 5 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fdobrovo

#7 Updated by fdobrovo over 5 years ago

  • Status changed from ASSIGNED to MODIFIED
  • % Done changed from 0 to 100

#8 Updated by semyers over 5 years ago

Please include a link to your pull request and set issues to POST when PRs are posted. Issues should not directly move from ASSIGNED to MODIFIED.

#9 Updated by semyers over 5 years ago

  • Platform Release set to 2.9.3

#10 Updated by semyers over 5 years ago

  • Status changed from MODIFIED to 5

#11 Updated by pthomas@redhat.com about 5 years ago

  • Status changed from 5 to 6

verified


pulp-admin -vv  rpm repo content errata --repo-id=repo --erratum-id DEMO_ID_1
2016-09-19 20:47:16,713 - DEBUG - sending POST request to /pulp/api/v2/repositories/repo/search/units/
2016-09-19 20:47:16,856 - INFO - POST request to /pulp/api/v2/repositories/repo/search/units/ with parameters {"criteria": {"type_ids": ["erratum"], "filters": {"unit": {"id": "DEMO_ID_1"}}}}
2016-09-19 20:47:16,857 - INFO - Response status : 200 

2016-09-19 20:47:16,857 - INFO - Response body :
 [
  {
    "updated": "2016-09-19T18:46:46Z", 
    "repo_id": "repo", 
    "created": "2016-09-19T18:46:46Z", 
    "unit_id": "68a1c130-a4f7-4e44-b100-e47964f498f7", 
    "unit_type_id": "erratum", 
    "_id": {
      "$oid": "57e0329656935afedeed1378"
    }, 
    "metadata": {
      "status": "final", 
      "updated": "2016-09-19 18:46:45 UTC", 
      "_id": "68a1c130-a4f7-4e44-b100-e47964f498f7", 
      "from": "pulp-list@redhat.com", 
      "description": "1: pulp-test-package now conserves your precious bits.", 
      "title": "1: pulp-test-package bit conservation", 
      "issued": "2016-09-19 18:46:45 UTC", 
      "_last_updated": 1474310806, 
      "pkglist": [
        {
          "_pulp_repo_id": "repo", 
          "packages": [
            {
              "src": "pulp-test-package-0.3.1-1.fc11.src.rpm", 
              "name": "pulp-test-package", 
              "arch": "x86_64", 
              "sums": "6bce3f26e1fc0fc52ac996f39c0d0e14fc26fb8077081d5b4dbfb6431b08aa9f", 
              "filename": "pulp-test-package-0.3.1-1.fc11.x86_64.rpm", 
              "epoch": "0", 
              "version": "0.3.1", 
              "release": "1.fc11", 
              "type": "sha256"
            }
          ], 
          "name": "el6", 
          "short": ""
        }
      ], 
      "pushcount": "1", 
      "version": "1", 
      "references": [
        {
          "href": "http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=123456", 
          "type": "bugzilla", 
          "id": "123456", 
          "title": "pulp-test-package-0.2.1 prints mean error messages to users"
        }, 
        {
          "href": "http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=654321", 
          "type": "bugzilla", 
          "id": "654321", 
          "title": "pulp-test-package-0.2.1 causes users' machines to run out of bits/bytes/whatever. The users must wait until the next supply comes next week"
        }
      ], 
      "pulp_user_metadata": {}, 
      "_content_type_id": "erratum", 
      "release": "el6", 
      "_ns": "units_erratum", 
      "reboot_suggested": false, 
      "type": "bugzilla", 
      "id": "DEMO_ID_1"
    }
  }
]

+----------------------------------------------------------------------+
                           Erratum: DEMO_ID_1
+----------------------------------------------------------------------+

Id:                DEMO_ID_1
Title:             1: pulp-test-package bit conservation
Summary:           None
Description:
  1: pulp-test-package now conserves your precious bits.

Severity:          None
Type:              bugzilla
Issued:            2016-09-19 18:46:45 UTC
Updated:           2016-09-19 18:46:45 UTC
Version:           1
Release:           el6
Status:            final
Reboot Suggested:  No

Updated Packages:
  pulp-test-package-0:0.3.1-1.fc11.x86_64

References:
  ID:   123456
  Type: bugzilla
  Link: http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=123456

  ID:   654321
  Type: bugzilla
  Link: http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=654321

#12 Updated by semyers about 5 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#14 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF