Bug 858037 - DB validation fails for roles created before db version 2
Summary: DB validation fails for roles created before db version 2
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience   
(Show other bugs)
Version: 2.0.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: Sprint 40
Assignee: Sayli Karmarkar
QA Contact: Preethi Thomas
URL:
Whiteboard:
Keywords:
Depends On: 858035
Blocks: 848520
TreeView+ depends on / blocked
 
Reported: 2012-09-17 20:34 UTC by Preethi Thomas
Modified: 2015-03-23 01:11 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 858035
Environment:
Last Closed: 2013-01-07 14:09:31 UTC
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)

Description Preethi Thomas 2012-09-17 20:34:57 UTC
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 21:40:45 UTC
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 22:56:26 UTC
build: 2.0.4

Comment 3 Preethi Thomas 2012-09-18 16:36:31 UTC
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 20:20:20 UTC
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 23:52:00 UTC
build: 2.0.5

Comment 6 Preethi Thomas 2012-09-19 17:24:32 UTC
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 20:03:01 UTC
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 14:09:31 UTC
Pulp 2.0 released.


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