diff options
| author | Jan Cholasta <jcholast@redhat.com> | 2015-09-11 13:43:28 +0200 |
|---|---|---|
| committer | Jan Cholasta <jcholast@redhat.com> | 2015-09-17 11:08:43 +0200 |
| commit | 23507e6124041ed17f39db211e802495e37520e7 (patch) | |
| tree | 8cf010848183a977fde0d5cdcd653556d215cd62 /ipaserver/install/plugins | |
| parent | 1550b5ab50966387bac19f46b34a2107010d08d4 (diff) | |
Alias "unicode" to "str" under Python 3
The six way of doing this is to replace all occurences of "unicode"
with "six.text_type". However, "unicode" is non-ambiguous and
(arguably) easier to read. Also, using it makes the patches smaller,
which should help with backporting.
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipaserver/install/plugins')
| -rw-r--r-- | ipaserver/install/plugins/rename_managed.py | 6 | ||||
| -rw-r--r-- | ipaserver/install/plugins/update_managed_permissions.py | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/ipaserver/install/plugins/rename_managed.py b/ipaserver/install/plugins/rename_managed.py index 4b42d48dc..873c3ddb0 100644 --- a/ipaserver/install/plugins/rename_managed.py +++ b/ipaserver/install/plugins/rename_managed.py @@ -17,11 +17,17 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. +import six + from ipalib import api, errors from ipalib import Updater from ipapython import ipautil from ipapython.dn import DN +if six.PY3: + unicode = str + + def entry_to_update(entry): """ Convert an entry into a name/value pair list that looks like an update. diff --git a/ipaserver/install/plugins/update_managed_permissions.py b/ipaserver/install/plugins/update_managed_permissions.py index 79af64c38..d68e24302 100644 --- a/ipaserver/install/plugins/update_managed_permissions.py +++ b/ipaserver/install/plugins/update_managed_permissions.py @@ -83,6 +83,8 @@ No other keys are allowed in the template The plugin also deletes permissions specified in OBSOLETE_PERMISSIONS. """ +import six + from ipalib import api, errors from ipapython.dn import DN from ipalib.plugable import Registry @@ -92,6 +94,9 @@ from ipalib.aci import ACI from ipalib import Updater from ipapython import ipautil +if six.PY3: + unicode = str + register = Registry() OBSOLETE_PERMISSIONS = { |
