Merge "Fixed issue with elevated contexts modifying the original context"
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import itertools
|
||||
import copy
|
||||
|
||||
from designate.openstack.common import context
|
||||
from designate.openstack.common import log as logging
|
||||
@@ -71,7 +72,7 @@ class DesignateContext(context.RequestContext):
|
||||
'user_identity': user_idt
|
||||
})
|
||||
|
||||
return d
|
||||
return copy.deepcopy(d)
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, values):
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
# under the License.
|
||||
from designate.tests import TestCase
|
||||
from designate import context
|
||||
from designate.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class TestDesignateContext(TestCase):
|
||||
@@ -30,3 +33,4 @@ class TestDesignateContext(TestCase):
|
||||
|
||||
self.assertFalse(ctxt.is_admin)
|
||||
self.assertTrue(admin_ctxt.is_admin)
|
||||
self.assertEqual(0, len(ctxt.roles))
|
||||
|
||||
Reference in New Issue
Block a user