The columns in the database have changed.
This commit is contained in:
parent
5ae344bcd8
commit
48e9b701f7
1 changed files with 16 additions and 16 deletions
|
@ -303,14 +303,14 @@ def main():
|
||||||
else:
|
else:
|
||||||
#ldapConn.add_s(dn, entry)
|
#ldapConn.add_s(dn, entry)
|
||||||
|
|
||||||
print "Adding group info for " + group[1] + "."
|
print "Adding group info for %s." % group[7]
|
||||||
#id0, name1, owner_id2, group_type3, needs_sponsor4, user_can_remove5, prerequisite_id6, joinmsg7
|
#id0, owner_id1, group_type2, needs_sponsor3, user_can_remove4, prerequisite_id5, joinmsg6, name7
|
||||||
|
|
||||||
uidLookupCursor = dbConn.cursor()
|
uidLookupCursor = dbConn.cursor()
|
||||||
uidLookupCursor.execute ("SELECT username FROM person where id =" + str(group[2]) )
|
uidLookupCursor.execute ("SELECT username FROM person where id =" + str(group[1]) )
|
||||||
owner = uidLookupCursor.fetchone()
|
owner = uidLookupCursor.fetchone()
|
||||||
if str(group[6]) != "None" :
|
if str(group[5]) != "None" :
|
||||||
uidLookupCursor.execute ("SELECT name FROM project_group where id =" + str(group[6]) )
|
uidLookupCursor.execute ("SELECT name FROM project_group where id =" + str(group[5]) )
|
||||||
prereq = uidLookupCursor.fetchone()
|
prereq = uidLookupCursor.fetchone()
|
||||||
print prereq
|
print prereq
|
||||||
else:
|
else:
|
||||||
|
@ -327,23 +327,23 @@ def main():
|
||||||
|
|
||||||
#we're using the boolean type for these. This means they need to be converted to the TRUE and FALSE strings
|
#we're using the boolean type for these. This means they need to be converted to the TRUE and FALSE strings
|
||||||
|
|
||||||
if str(group[4]) == "0" :
|
if str(group[3]) == "0" :
|
||||||
|
group[3]="FALSE"
|
||||||
|
else:
|
||||||
|
group[3]="TRUE"
|
||||||
|
|
||||||
|
if str(group[5]) == "0" :
|
||||||
group[4]="FALSE"
|
group[4]="FALSE"
|
||||||
else:
|
else:
|
||||||
group[4]="TRUE"
|
group[4]="TRUE"
|
||||||
|
|
||||||
if str(group[5]) == "0" :
|
|
||||||
group[5]="FALSE"
|
|
||||||
else:
|
|
||||||
group[5]="TRUE"
|
|
||||||
|
|
||||||
|
|
||||||
userLdif.append(["fedoraGroupNeedsSponsor",[str(group[4])]]) #need to convert to bool
|
userLdif.append(["fedoraGroupNeedsSponsor",[str(group[3])]]) #need to convert to bool
|
||||||
userLdif.append(["fedoraGroupUserCanRemove",[str(group[5])]]) #need to convert to bool
|
userLdif.append(["fedoraGroupUserCanRemove",[str(group[4])]]) #need to convert to bool
|
||||||
#userLdif.append(["groupPrerequisite",[str(group[6])]])
|
#userLdif.append(["groupPrerequisite",[str(group[5])]])
|
||||||
#userLdif.append(["groupPrerequisite",prereq]) not currently in the schema
|
#userLdif.append(["groupPrerequisite",prereq]) not currently in the schema
|
||||||
userLdif.append(["fedoraGroupJoinMsg",[str(group[7]) or "None" ]])
|
userLdif.append(["fedoraGroupJoinMsg",[str(group[6]) or "None" ]])
|
||||||
ldifWriter.unparse("cn=" + str(group[1]) +",ou=FedoraGroups,dc=fedoraproject,dc=org" , userLdif )
|
ldifWriter.unparse("cn=" + str(group[7]) +",ou=FedoraGroups,dc=fedoraproject,dc=org" , userLdif )
|
||||||
|
|
||||||
|
|
||||||
groupCursor.close()
|
groupCursor.close()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue