diff --git a/hooks/keystone_context.py b/hooks/keystone_context.py
index 698c73b70fcb0f59a59ac4ba2cbeb1f2c0377651..febdd85f3297ea80985122230dfffd955fc7d09b 100644
--- a/hooks/keystone_context.py
+++ b/hooks/keystone_context.py
@@ -418,9 +418,9 @@ class TokenFlushContext(context.OSContextGenerator):
 class IdpFetchContext(context.OSContextGenerator):
 
     def __call__(self):
-        from keystone_utils import (get_api_suffix,
-            api_port, endpoint_url, resolve_address, ADMIN,
-        )
+        from keystone_utils import (get_api_suffix, api_port, endpoint_url,
+                                    resolve_address, ADMIN
+                                    )
         ctxt = {
             'enable_saml2': config('enable-saml2'),
             'remote_ids_fetch': is_elected_leader(DC_RESOURCE_NAME) and
diff --git a/hooks/keystone_hooks.py b/hooks/keystone_hooks.py
index 3e531eee171522d0ebc7665a43d3e222f7216f8e..b5386523604e3ae8bec6980090934b35da4668e2 100755
--- a/hooks/keystone_hooks.py
+++ b/hooks/keystone_hooks.py
@@ -91,7 +91,6 @@ from keystone_utils import (
     is_db_ready,
     is_db_initialised,
     filter_null,
-    ensure_permissions,
     is_service_present,
     delete_service_entry,
     assess_status,
diff --git a/hooks/keystone_utils.py b/hooks/keystone_utils.py
index f248ab406ea5da33a663e776605efaf6c34aaf47..a0eee3126a4150a6a7480efe8bb72b4c0297d95b 100644
--- a/hooks/keystone_utils.py
+++ b/hooks/keystone_utils.py
@@ -1328,38 +1328,6 @@ def is_password_changed(username, passwd):
     return (_passwd is None or passwd != _passwd)
 
 
-def ensure_permissions(path, user=None, group=None, perms=None, recurse=False,
-                       maxdepth=50):
-    """Set chownand chmod for path
-
-    Note that -1 for uid or gid result in no change.
-    """
-    if user:
-        uid = pwd.getpwnam(user).pw_uid
-    else:
-        uid = -1
-
-    if group:
-        gid = grp.getgrnam(group).gr_gid
-    else:
-        gid = -1
-
-    os.chown(path, uid, gid)
-
-    if perms:
-        os.chmod(path, perms)
-
-    if recurse:
-        if not maxdepth:
-            log("Max recursion depth reached - skipping further recursion")
-            return
-
-        paths = glob.glob("%s/*" % (path))
-        for path in paths:
-            ensure_permissions(path, user=user, group=group, perms=perms,
-                               recurse=recurse, maxdepth=maxdepth - 1)
-
-
 def relation_list(rid):
     cmd = [
         'relation-list',