Renames switchToRbacRole to toggle_rbac_role

This is a trivial change that renames switchToRbacRole to
toggle_rbac_role.

This change is needed because:
  - switchToRbacRole is camel case which is inconsistent with
    all the snake-case variables names throughout Patrole and
    OpenStack
  - It violates Python's naming conventions [0].

[0] See pep8 styling guideline:

"Function names should be lowercase, with words separated
by underscores as necessary to improve readability. mixedCase
is allowed only in contexts where that's already the prevailing
style."

And for variable names:

"Use the function naming rules: lowercase with words separated
by underscores as necessary to improve readability."

Change-Id: Ib6dd50ba02c25d585e2ca0c9383771f9337212b8
Depends-On: Ie1c4b6a2801f10c8e83f6d3f88fe0364d69317fa
diff --git a/patrole_tempest_plugin/rbac_utils.py b/patrole_tempest_plugin/rbac_utils.py
index 70fe0b7..4bfa7fe 100644
--- a/patrole_tempest_plugin/rbac_utils.py
+++ b/patrole_tempest_plugin/rbac_utils.py
@@ -42,7 +42,7 @@
 @six.add_metaclass(Singleton)
 class RbacUtils(object):
 
-    # References the last value of `switch_to_rbac_role` that was passed to
+    # References the last value of `toggle_rbac_role` that was passed to
     # `switch_role`. Used for ensuring that `switch_role` is correctly used
     # in a test file, so that false positives are prevented. The key used
     # to index into the dictionary is the module path plus class name, which is
@@ -51,7 +51,7 @@
     admin_role_id = None
     rbac_role_id = None
 
-    def switch_role(self, test_obj, switchToRbacRole=False):
+    def switch_role(self, test_obj, toggle_rbac_role=False):
         self.user_id = test_obj.auth_provider.credentials.user_id
         self.project_id = test_obj.auth_provider.credentials.tenant_id
         self.token = test_obj.auth_provider.get_token()
@@ -62,15 +62,15 @@
         else:
             self.roles_client = test_obj.os_admin.roles_client
 
-        LOG.debug('Switching role to: %s', switchToRbacRole)
+        LOG.debug('Switching role to: %s', toggle_rbac_role)
 
         try:
             if not self.admin_role_id or not self.rbac_role_id:
                 self._get_roles()
 
-            rbac_utils._validate_switch_role(self, test_obj, switchToRbacRole)
+            rbac_utils._validate_switch_role(self, test_obj, toggle_rbac_role)
 
-            if switchToRbacRole:
+            if toggle_rbac_role:
                 self._add_role_to_user(self.rbac_role_id)
             else:
                 self._add_role_to_user(self.admin_role_id)
@@ -116,7 +116,7 @@
 
         return False
 
-    def _validate_switch_role(self, test_obj, switchToRbacRole):
+    def _validate_switch_role(self, test_obj, toggle_rbac_role):
         """Validates that the rbac role passed to `switch_role` is legal.
 
         Throws an error for the following improper usages of `switch_role`:
@@ -124,9 +124,9 @@
             * `switch_role` is never called in a test file, except in tearDown
             * `switch_role` is called with the same boolean value twice
         """
-        if not isinstance(switchToRbacRole, bool):
+        if not isinstance(toggle_rbac_role, bool):
             raise rbac_exceptions.RbacResourceSetupFailed(
-                'switchToRbacRole must be a boolean value.')
+                'toggle_rbac_role must be a boolean value.')
 
         # The unique key is the combination of module path plus class name.
         class_name = test_obj.__name__ if isinstance(test_obj, type) else \
@@ -136,19 +136,19 @@
 
         self.switch_role_history.setdefault(key, None)
 
-        if self.switch_role_history[key] == switchToRbacRole:
+        if self.switch_role_history[key] == toggle_rbac_role:
             # If the test was skipped, then this is a legitimate use case,
             # so do not throw an exception.
             exc_value = sys.exc_info()[1]
             if not isinstance(exc_value, testtools.TestCase.skipException):
                 self.switch_role_history[key] = False
-                error_message = '`switchToRbacRole` must not be called with '\
+                error_message = '`toggle_rbac_role` must not be called with '\
                     'the same bool value twice. Make sure that you included '\
                     'a rbac_utils.switch_role method call inside the test.'
                 LOG.error(error_message)
                 raise rbac_exceptions.RbacResourceSetupFailed(error_message)
         else:
-            self.switch_role_history[key] = switchToRbacRole
+            self.switch_role_history[key] = toggle_rbac_role
 
     def _get_roles(self):
         available_roles = self.roles_client.list_roles()