summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavanum Srinivas <dims@linux.vnet.ibm.com>2013-07-01 20:20:53 -0400
committerDavanum Srinivas <dims@linux.vnet.ibm.com>2013-07-01 20:20:53 -0400
commitb21fc56486843ab301aaa5acf55c164003d2c6a1 (patch)
tree3a690b1049f9ae9fefa421adae66634d85d8d46e
parent262d6a5f53e1ecfdcf7f605e011b9985fcd62822 (diff)
downloadoslo-b21fc56486843ab301aaa5acf55c164003d2c6a1.zip
oslo-b21fc56486843ab301aaa5acf55c164003d2c6a1.tar.gz
oslo-b21fc56486843ab301aaa5acf55c164003d2c6a1.tar.xz
Fix bad default for show_deleted
replace "no" (string) with False (boolean). Added a test case Fixes LP# 1195511 Change-Id: Ib72689b11d747508850ccab8ef1d73727da2caa6
-rw-r--r--openstack/common/context.py2
-rw-r--r--tests/unit/test_context.py4
2 files changed, 5 insertions, 1 deletions
diff --git a/openstack/common/context.py b/openstack/common/context.py
index 3899c2c..81772bc 100644
--- a/openstack/common/context.py
+++ b/openstack/common/context.py
@@ -61,7 +61,7 @@ class RequestContext(object):
'request_id': self.request_id}
-def get_admin_context(show_deleted="no"):
+def get_admin_context(show_deleted=False):
context = RequestContext(None,
tenant=None,
is_admin=True,
diff --git a/tests/unit/test_context.py b/tests/unit/test_context.py
index 0db7aaa..2f9a3de 100644
--- a/tests/unit/test_context.py
+++ b/tests/unit/test_context.py
@@ -24,3 +24,7 @@ class ContextTest(utils.BaseTestCase):
def test_context(self):
ctx = context.RequestContext()
self.assertTrue(ctx)
+
+ def test_admin_context_show_deleted_flag_default(self):
+ ctx = context.get_admin_context()
+ self.assertFalse(ctx.show_deleted)