Bug 858037 - DB validation fails for roles created before db version 2
DB validation fails for roles created before db version 2
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: user-experience (Show other bugs)
2.0.6
Unspecified Unspecified
unspecified Severity medium
: ---
: Sprint 40
Assigned To: Sayli Karmarkar
Preethi Thomas
:
Depends On: 858035
Blocks: 848520
  Show dependency treegraph
 
Reported: 2012-09-17 16:34 EDT by Preethi Thomas
Modified: 2015-03-22 21:11 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 858035
Environment:
Last Closed: 2013-01-07 09:09:31 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Preethi Thomas 2012-09-17 16:34:57 EDT
clone for community release.

+++ This bug was initially created as a clone of Bug #858035 +++

We used to role name as the unique identifier for a role. To keep it consistent with all the other db entities in v2, we changed it to have display_name, description and have role id string as the unique identity for a role. We need to add db migrate script for the same in order to preserve and validate old role db entries.
Comment 1 Sayli Karmarkar 2012-09-17 17:40:45 EDT
commit 7c7e1de1219ebfee7b8e39aa7c27bb827746f54a
Merge: cf2c5c4 7afd03c
Author: skarmark <skarmark@redhat.com>
Date:   Mon Sep 17 14:39:32 2012 -0700

    Merge pull request #57 from pulp/skarmark-858037
    
    858037 - adding db migration script to make role id a unique key, changing role name to display_name and adding description to keep it consistent
Comment 2 Jeff Ortel 2012-09-17 18:56:26 EDT
build: 2.0.4
Comment 3 Preethi Thomas 2012-09-18 12:36:31 EDT
Looks like this is failing

[root@preethi-el6-pulp ~]# rpm -q pulp-rpm-server
pulp-rpm-server-2.0.4-1.el6.noarch
[root@preethi-el6-pulp ~]# 

from db.log
migration to data model version 3 complete
migration to data model version 4 started
migration to data model version 4 complete
model validation failure in Permission for model 50474dc2196f454742000015: field resource is <class 'bson.son.SON'> not <type 'unicode'>
model validation failure in Permission for model 50474dd8196f45474200001e: field resource is <class 'bson.son.SON'> not <type 'unicode'>
model validation failure in Permission for model 50474ea4196f454742000029: field resource is <class 'bson.son.SON'> not <type 'unicode'>
model validation failure in Permission for model 50474ed7196f454742000033: field resource is <class 'bson.son.SON'> not <type 'unicode'>
model validation failure in Permission for model 50475278196f454742000043: field resource is <class 'bson.son.SON'> not <type 'unicode'>
model validation failure in Permission for model 504a0ffb196f455075001550: field resource is <class 'bson.son.SON'> not <type 'unicode'>
model validation failure in Role for model 504a0b92196f45507500153b: field display_name is <type 'NoneType'> not <type 'unicode'>
Comment 4 Sayli Karmarkar 2012-09-18 16:20:20 EDT
commit 23e2163591e76769a5b234c82de8d14591a59c34
Author: Sayli Karmarkar <skarmark@redhat.com>
Date:   Tue Sep 18 13:16:41 2012 -0700

    858037 - Fixed and added safety check to avoid adding permissions with resource type dict, added migrate script to delete all the old such entries
Comment 5 Jeff Ortel 2012-09-18 19:52:00 EDT
build: 2.0.5
Comment 6 Preethi Thomas 2012-09-19 13:24:32 EDT
verified the db migration run without errors
[root@preethi-el6-pulp ~]# rpm -qa pulp-rpm-server
pulp-rpm-server-2.0.5-1.el6.noarch
[root@preethi-el6-pulp ~]# 

migration to data model version 1 started
migration to data model version 1 complete
migration to data model version 2 started
migration to data model version 2 complete
migration to data model version 3 started
migration to data model version 3 complete
migration to data model version 4 started
migration to data model version 4 complete
migration to data model version 5 started
migration to data model version 5 complete
Comment 7 Jay Dobies 2013-01-03 15:03:01 EST
Moving these up against the 2.0 Beta so we can delete the CR-2 version from bugzilla.
Comment 8 Preethi Thomas 2013-01-07 09:09:31 EST
Pulp 2.0 released.

Note You need to log in before you can comment on or make changes to this bug.