Skip to content

Commit 8d49cf8

Browse files
committed
[bugfix] fix string %s issue with unicode
It is possible for shell to return unicode. It's perfectly fine. Nothing wrong with that. Issue happen when doing substitution. A unicode cannot do substitution in python2's string (byte). The solution is to separate it. Signed-off-by: misterpah <misterpah@gmail.com>
1 parent c8534ca commit 8d49cf8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

st2common/st2common/util/pack_management.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def apply_pack_owner_group(pack_path):
318318
pack_group = utils.get_pack_group()
319319

320320
if pack_group:
321-
LOG.debug('Changing owner group of "%s" directory to %s' % (pack_path, pack_group))
321+
LOG.debug('Changing owner group of "{}" directory to {}'.format(pack_path, pack_group))
322322

323323
if SUDO_BINARY:
324324
args = ['sudo', 'chgrp', '-R', pack_group, pack_path]
@@ -330,8 +330,8 @@ def apply_pack_owner_group(pack_path):
330330

331331
if exit_code != 0:
332332
# Non fatal, but we still log it
333-
LOG.debug('Failed to change owner group on directory "%s" to "%s": %s' %
334-
(pack_path, pack_group, stderr))
333+
LOG.debug('Failed to change owner group on directory "{}" to "{}":'.format(pack_path, pack_group))
334+
LOG.debug(stderr)
335335

336336
return True
337337

0 commit comments

Comments
 (0)