Sapan Bhatia | 24836f1 | 2013-08-27 10:16:05 -0400 | [diff] [blame] | 1 | import os |
| 2 | import base64 |
| 3 | from planetstack.config import Config |
Sapan Bhatia | 04c94ad | 2013-09-02 18:00:28 -0400 | [diff] [blame] | 4 | from observer.openstacksyncstep import OpenStackSyncStep |
| 5 | from core.models.slice import * |
Sapan Bhatia | 24836f1 | 2013-08-27 10:16:05 -0400 | [diff] [blame] | 6 | |
| 7 | class SyncSliceMemberships(OpenStackSyncStep): |
Tony Mack | ce79de0 | 2013-09-24 10:12:33 -0400 | [diff] [blame] | 8 | requested_interval=0 |
| 9 | provides=[SliceRole] |
| 10 | def sync_record(self, user): |
| 11 | if slice_memb.user.kuser_id and slice_memb.slice.tenant_id: |
| 12 | self.driver.add_user_role(slice_memb.user.kuser_id, |
| 13 | slice_memb.slice.tenant_id, |
| 14 | slice_memb.role.role_type) |