mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Decode script arguments using file system encoding
This mimics Python 3's behavior, where sys.argv is automatically decoded using file system encoding, as returned by sys.getfilesystemencoding(). This includes reimplementation of os.fsdecode() from Python 3. Reviewed-By: Petr Viktorin <pviktori@redhat.com>
This commit is contained in:
@@ -63,7 +63,7 @@ if len(args) != 1:
|
||||
# LSB status code 2: invalid or excess argument(s)
|
||||
raise ScriptError("You must specify trusted domain name", 2)
|
||||
|
||||
trusted_domain = unicode(args[0].lower())
|
||||
trusted_domain = ipautil.fsdecode(args[0]).lower()
|
||||
|
||||
env = Env()
|
||||
env._bootstrap(context='server', debug=options.debug, log=None)
|
||||
|
||||
@@ -707,7 +707,7 @@ def del_master_managed(realm, hostname, options):
|
||||
Removing of master in managed_topology
|
||||
"""
|
||||
|
||||
hostname_u = unicode(hostname)
|
||||
hostname_u = ipautil.fsdecode(hostname)
|
||||
if hostname == options.host:
|
||||
print("Can't remove itself: %s" % (options.host))
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user