From patchwork Wed Nov 25 12:21:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Lautrbach X-Patchwork-Id: 7698771 Return-Path: X-Original-To: patchwork-selinux@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6EA14BF90C for ; Wed, 25 Nov 2015 12:24:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB8D9208D1 for ; Wed, 25 Nov 2015 12:24:31 +0000 (UTC) Received: from emvm-gh1-uea08.nsa.gov (emvm-gh1-uea08.nsa.gov [63.239.67.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC74F20825 for ; Wed, 25 Nov 2015 12:24:30 +0000 (UTC) X-TM-IMSS-Message-ID: <5a787cb900045851@nsa.gov> Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by nsa.gov ([10.208.42.193]) with ESMTP (TREND IMSS SMTP Service 7.1) id 5a787cb900045851 ; Wed, 25 Nov 2015 07:22:39 -0500 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id tAPCLmnx019904; Wed, 25 Nov 2015 07:22:03 -0500 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id tAPCLirq039861 for ; Wed, 25 Nov 2015 07:21:44 -0500 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id tAPCLhaV019902 for ; Wed, 25 Nov 2015 07:21:44 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1C8AABbplVWnBy3hNFeGQEDAQ4BAQKDXm+vBwGNHYQPGYV2gUVMAQEBAQEBEgEBAQEBBg0JCSGFYoEeM4guvjCGVIolhBIFjSGJNIUliA2CJIxGjW6CLQELUYFecYUsAQEB X-IPAS-Result: A1C8AABbplVWnBy3hNFeGQEDAQ4BAQKDXm+vBwGNHYQPGYV2gUVMAQEBAQEBEgEBAQEBBg0JCSGFYoEeM4guvjCGVIolhBIFjSGJNIUliA2CJIxGjW6CLQELUYFecYUsAQEB X-IronPort-AV: E=Sophos;i="5.20,342,1444708800"; d="scan'208";a="4963325" Received: from emvm-gh1-uea09.nsa.gov ([63.239.67.10]) by goalie.tycho.ncsc.mil with ESMTP; 25 Nov 2015 07:21:27 -0500 X-TM-IMSS-Message-ID: <5a7039cf0004ae5f@nsa.gov> Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by nsa.gov ([63.239.67.10]) with ESMTP (TREND IMSS SMTP Service 7.1; TLSv1/SSLv3 ADH-AES256-SHA (256/256)) id 5a7039cf0004ae5f ; Wed, 25 Nov 2015 07:22:28 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 8E82D8F033 for ; Wed, 25 Nov 2015 12:21:25 +0000 (UTC) Received: from hulk.com ([10.34.250.101]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAPCLN4C031373; Wed, 25 Nov 2015 07:21:24 -0500 From: Petr Lautrbach To: selinux@tycho.nsa.gov Subject: [PATCH] policycoreutils: replace string.join() with str.join() Date: Wed, 25 Nov 2015 13:21:20 +0100 Message-Id: <1448454080-30617-1-git-send-email-plautrba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-TM-AS-MML: disable X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes Python 3 error: AttributeError: module 'string' has no attribute 'join' Based on a patch by Tomas Radej Signed-off-by: Petr Lautrbach --- policycoreutils/semanage/seobject.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/policycoreutils/semanage/seobject.py b/policycoreutils/semanage/seobject.py index d29dba5..c52be75 100644 --- a/policycoreutils/semanage/seobject.py +++ b/policycoreutils/semanage/seobject.py @@ -846,7 +846,7 @@ class seluserRecords(semanageRecords): def __modify(self, name, roles=[], selevel="", serange="", prefix=""): oldserole = "" oldserange = "" - newroles = string.join(roles, ' ') + newroles = " ".join(roles) if prefix == "" and len(roles) == 0 and serange == "" and selevel == "": if is_mls_enabled == 1: raise ValueError(_("Requires prefix, roles, level or range")) @@ -870,7 +870,7 @@ class seluserRecords(semanageRecords): oldserange = semanage_user_get_mlsrange(u) (rc, rlist) = semanage_user_get_roles(self.sh, u) if rc >= 0: - oldserole = string.join(rlist, ' ') + oldserole = " ".join(rlist) if (is_mls_enabled == 1) and (serange != ""): semanage_user_set_mlsrange(self.sh, u, untranslate(serange)) @@ -980,7 +980,7 @@ class seluserRecords(semanageRecords): if rc < 0: 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) return ddict