~ubuntu-branches/ubuntu/raring/keystone/raring-updates

« back to all changes in this revision

Viewing changes to keystone/identity/controllers.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2013-10-17 13:52:59 UTC
  • mfrom: (1.1.37)
  • mto: This revision was merged to the branch mainline in revision 50.
  • Revision ID: package-import@ubuntu.com-20131017135259-dqiwbrzjs1q4mp6q
Tags: 1:2013.1.4-0ubuntu1
* Resynchronize with stable/grizzly (9666fc0) (LP: #1241202):
  - [6792499] periodic-keystone-python27-stable-grizzly fails due to"No
    module named netaddr"   LP: 1212939
  - [775d7a7] Fix and test token revocation list API
  - [0876ea2] N+1 lookups in groups SQL LP: 1218675
  - [afbc75b] Disabling a tenant would not disable a user token LP: 1179955
  - [9666fc0] User operations with LDAP Identity and
    enabled_mask/user_enabled_default fail LP: 1210175

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
        # be specifying that
112
112
        clean_tenant = tenant.copy()
113
113
        clean_tenant.pop('domain_id', None)
 
114
 
 
115
        # If the project has been disabled (or enabled=False) we are
 
116
        # deleting the tokens for that project.
 
117
        if not tenant.get('enabled', True):
 
118
            self._delete_tokens_for_project(context, tenant_id)
 
119
 
114
120
        tenant_ref = self.identity_api.update_project(
115
121
            context, tenant_id, clean_tenant)
116
122
        return {'tenant': tenant_ref}
117
123
 
118
124
    def delete_project(self, context, tenant_id):
119
125
        self.assert_admin(context)
 
126
        # Delete all tokens belonging to the users for that project
 
127
        self._delete_tokens_for_project(context, tenant_id)
120
128
        self.identity_api.delete_project(context, tenant_id)
121
129
 
122
130
    def get_project_users(self, context, tenant_id, **kw):
571
579
    def update_project(self, context, project_id, project):
572
580
        self._require_matching_id(project_id, project)
573
581
 
 
582
        # The project was disabled so we delete the tokens
 
583
        if not project.get('enabled', True):
 
584
            self._delete_tokens_for_project(context, project_id)
 
585
 
574
586
        ref = self.identity_api.update_project(context, project_id, project)
575
587
        return ProjectV3.wrap_member(context, ref)
576
588
 
579
591
        for cred in self.identity_api.list_credentials(context):
580
592
            if cred['project_id'] == project_id:
581
593
                self.identity_api.delete_credential(context, cred['id'])
 
594
 
 
595
        # Delete all tokens belonging to the users for that project
 
596
        self._delete_tokens_for_project(context, project_id)
 
597
 
582
598
        # Finally delete the project itself - the backend is
583
599
        # responsible for deleting any role assignments related
584
600
        # to this project