In get_cgroup_mounts(), both files '/proc/mounts' and
'<mountpoint>/cgroup.controller' uses 'line' as loop variable
to read lines from the file. The issue here is that, they are
nested. This patch renames second loop variable
'line' -> 'ctrlf_line'.
Reported-by: LGTM
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
with open(os.path.join(mount.mount_point,
'cgroup.controllers')) as ctrlf:
- for line in ctrlf.readlines():
- for ctrl in line.split():
+ for ctrlf_line in ctrlf.readlines():
+ for ctrl in ctrlf_line.split():
mount_copy = copy.deepcopy(mount)
mount_copy.controller = ctrl
mount_list.append(mount_copy)