LDAP models do not support create

Bug #923755 reported by Adam Young on 2012-01-30
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Undecided
Unassigned

Bug Description

Running the command:

 bin/keystone-manage create_tenant --name TEST_TENANT

causes the error:

  File "/home/ayoung/devel/openstack/keystone/keystone/backends/ldap/api/tenant.py", line 29, in create
    data = values.copy()
AttributeError: 'Tenant' object has no attribute 'copy'

Adding in the following change makes this line of code work, although things still fail further on:

diff --git a/keystone/backends/ldap/models.py b/keystone/backends/ldap/models.py
index d0c9ffc..415ac1b 100644
--- a/keystone/backends/ldap/models.py
+++ b/keystone/backends/ldap/models.py
@@ -34,6 +34,10 @@ def create_model(name, attrs):

         def __len__(self):
             return len(attrs)
+
+ def copy(self):
+ """Make the model object behave like a dict."""
+ return dict(self).copy()
     Cmapper.__name__ = name
     return Cmapper

This line is grabbed from the sqlalchemy model file.

Dolph Mathews (dolph) wrote :

This code has been completely removed in the current codebase (post-merge of redux); please re-open if I'm mistaken.

Changed in keystone:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers