diff options
author | Devananda van der Veen <devananda.vdv@gmail.com> | 2013-11-14 20:18:21 -0800 |
---|---|---|
committer | Devananda van der Veen <devananda.vdv@gmail.com> | 2013-11-15 15:35:37 -0800 |
commit | 61ae0a77c15952540fef9894d94c39fac7b6345a (patch) | |
tree | 443046bf79e41f394262e7809f486ce69f861c14 /ironic | |
parent | df83fa1e7820f0e94ae3a4bfc8580ca7ed0b4ec3 (diff) | |
download | ironic-61ae0a77c15952540fef9894d94c39fac7b6345a.tar.gz |
sync common.context from oslo
Change-Id: Icd4ae27d276fe0fd678b2e39c6c08473fa0def04
Diffstat (limited to 'ironic')
-rw-r--r-- | ironic/openstack/common/context.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ironic/openstack/common/context.py b/ironic/openstack/common/context.py index 7172c1bc7..8dd7936a6 100644 --- a/ironic/openstack/common/context.py +++ b/ironic/openstack/common/context.py @@ -33,19 +33,22 @@ def generate_request_id(): class RequestContext(object): - """ + """Helper class to represent useful information about a request context. + Stores information about the security context under which the user accesses the system, as well as additional request information. """ def __init__(self, auth_token=None, user=None, tenant=None, is_admin=False, - read_only=False, show_deleted=False, request_id=None): + read_only=False, show_deleted=False, request_id=None, + instance_uuid=None): self.auth_token = auth_token self.user = user self.tenant = tenant self.is_admin = is_admin self.read_only = read_only self.show_deleted = show_deleted + self.instance_uuid = instance_uuid if not request_id: request_id = generate_request_id() self.request_id = request_id @@ -57,10 +60,11 @@ class RequestContext(object): 'read_only': self.read_only, 'show_deleted': self.show_deleted, 'auth_token': self.auth_token, - 'request_id': self.request_id} + 'request_id': self.request_id, + 'instance_uuid': self.instance_uuid} -def get_admin_context(show_deleted="no"): +def get_admin_context(show_deleted=False): context = RequestContext(None, tenant=None, is_admin=True, |