mirror of
https://github.com/SELinuxProject/selinux
synced 2025-04-01 23:08:09 +00:00
policycoreutils: replace string.join() with str.join()
Fixes Python 3 error: AttributeError: module 'string' has no attribute 'join' Based on a patch by Tomas Radej <tradej@redhat.com> Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
This commit is contained in:
parent
b300d3d43a
commit
fa438ddf50
@ -846,7 +846,7 @@ class seluserRecords(semanageRecords):
|
|||||||
def __modify(self, name, roles=[], selevel="", serange="", prefix=""):
|
def __modify(self, name, roles=[], selevel="", serange="", prefix=""):
|
||||||
oldserole = ""
|
oldserole = ""
|
||||||
oldserange = ""
|
oldserange = ""
|
||||||
newroles = string.join(roles, ' ')
|
newroles = " ".join(roles)
|
||||||
if prefix == "" and len(roles) == 0 and serange == "" and selevel == "":
|
if prefix == "" and len(roles) == 0 and serange == "" and selevel == "":
|
||||||
if is_mls_enabled == 1:
|
if is_mls_enabled == 1:
|
||||||
raise ValueError(_("Requires prefix, roles, level or range"))
|
raise ValueError(_("Requires prefix, roles, level or range"))
|
||||||
@ -870,7 +870,7 @@ class seluserRecords(semanageRecords):
|
|||||||
oldserange = semanage_user_get_mlsrange(u)
|
oldserange = semanage_user_get_mlsrange(u)
|
||||||
(rc, rlist) = semanage_user_get_roles(self.sh, u)
|
(rc, rlist) = semanage_user_get_roles(self.sh, u)
|
||||||
if rc >= 0:
|
if rc >= 0:
|
||||||
oldserole = string.join(rlist, ' ')
|
oldserole = " ".join(rlist)
|
||||||
|
|
||||||
if (is_mls_enabled == 1) and (serange != ""):
|
if (is_mls_enabled == 1) and (serange != ""):
|
||||||
semanage_user_set_mlsrange(self.sh, u, untranslate(serange))
|
semanage_user_set_mlsrange(self.sh, u, untranslate(serange))
|
||||||
@ -980,7 +980,7 @@ class seluserRecords(semanageRecords):
|
|||||||
if rc < 0:
|
if rc < 0:
|
||||||
raise ValueError(_("Could not list roles for user %s") % name)
|
raise ValueError(_("Could not list roles for user %s") % name)
|
||||||
|
|
||||||
roles = string.join(rlist, ' ')
|
roles = " ".join(rlist)
|
||||||
ddict[semanage_user_get_name(u)] = (semanage_user_get_prefix(u), semanage_user_get_mlslevel(u), semanage_user_get_mlsrange(u), roles)
|
ddict[semanage_user_get_name(u)] = (semanage_user_get_prefix(u), semanage_user_get_mlslevel(u), semanage_user_get_mlsrange(u), roles)
|
||||||
|
|
||||||
return ddict
|
return ddict
|
||||||
|
Loading…
Reference in New Issue
Block a user