~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/context.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-02-10 11:25:38 UTC
  • mto: This revision was merged to the branch mainline in revision 65.
  • Revision ID: package-import@ubuntu.com-20120210112538-3jcp8w9huic41e45
Tags: upstream-2012.1~e4~20120210.12574
ImportĀ upstreamĀ versionĀ 2012.1~e4~20120210.12574

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
        self.is_admin = is_admin
52
52
        if self.is_admin is None:
53
53
            self.is_admin = 'admin' in [x.lower() for x in self.roles]
 
54
        elif self.is_admin and 'admin' not in self.roles:
 
55
            self.roles.append('admin')
54
56
        self.read_deleted = read_deleted
55
57
        self.remote_address = remote_address
56
58
        if not timestamp:
87
89
        context = copy.copy(self)
88
90
        context.is_admin = True
89
91
 
 
92
        if 'admin' not in context.roles:
 
93
            context.roles.append('admin')
 
94
 
90
95
        if read_deleted is not None:
91
96
            context.read_deleted = read_deleted
92
97