Bug 790751
| Summary: | Time validation should be done against the last imported manifest's creating time | ||
|---|---|---|---|
| Product: | [Retired] Subscription Asset Manager | Reporter: | yu zheng <yuzheng> |
| Component: | candlepin | Assignee: | Chris Duryee <cduryee> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | SAM QE List <sam-qe-list> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 1.0.0 | CC: | cduryee, esammons, jomara, khong |
| Target Milestone: | --- | Keywords: | Triaged |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-08-22 13:23:09 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 803375 | ||
d20b731 master 0.5.22+ Yu, Thanks for the detailed bug report. Eric, There is a rule in candlepin that prevents a user who imported a manifest from one upstream consumer to re-import with a different upstream consumer. It looks like manifest1 was created with upstream consumer 81a76f13-d6f3-446a-a7f3-383d4c69b263, but manifest2 was created with 0a152131-7be9-4876-8247-e38113fd9b74. If you create two imports from the same upstream consumer, does that work? |
Description of problem: During importing manifests, the time validation should be done against last imported manifest's creating time, but not the last importing time. Version-Release number of selected component (if applicable): katello-headpin-all-0.1.135-2.el6.noarch katello-cli-headpin-0.1.15-2.el6.noarch thumbslug-0.0.21-1.el6.noarch candlepin-0.5.18-1.el6.noarch How reproducible: always Steps to Reproduce: 1.Prepare three manifests which were exported from the same distributor in order :1) manifest1 2) manifest2 3) manifest3 2.Import manifest1 to SAM. # headpin -u admin -p admin provider import_manifest --org=org1 --name="Red Hat" --file=manifest1.zip Manifest imported 3.Import manifest2 to SAM. # headpin -u admin -p admin provider import_manifest --org=org1 --name="Red Hat" --file=manifest2.zip Manifest imported 4.Import manifest3 to SAM. # headpin -u admin -p admin provider import_manifest --org=org1 --name="Red Hat" --file=manifest3.zip Actual results: Importing manifest, please wait... Manifest import for provider [ Red Hat ] failed, Candlepin::Owner: 409 Conflict {"displayMessage":"Import is older than existing data"} (POST /candlepin/owners/org_test/imports) Expected results: As manifest3 is newer than existing one(manifest2), it should be imported successfully. Additional info: 1.metadata of these manifests: 1)manifest1 {"version":"0.0.0","created":"2011-12-13T13:39:18.111+0000"} 2)manifest2 {"version":"0.5.5-1","created":"2012-01-09T02:45:23.545+0000"} 3)manifest3 {"version":"0.5.5-1","created":"2012-01-12T02:14:21.037+0000"} 2.related candlepin code candlepin/sync/Importer.java public void validateMetadata(String type, Owner owner, File meta, boolean force) throws IOException, ImporterException { ...... if (lastrun == null) { // this is our first import, let's create a new entry lastrun = new ExporterMetadata(type, m.getCreated(), owner); lastrun = expMetaCurator.create(lastrun); } else { if (!force && lastrun.getExported().compareTo(m.getCreated()) >= 0){ throw new ConflictException(i18n.tr("Import is older than existing data")); } else { lastrun.setExported(new Date()); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^shoud be set to creating time of the imported manifest expMetaCurator.merge(lastrun); } } }