mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Py3 compatibility fixes.
This commit is contained in:
parent
f4f323e86a
commit
ca427955d5
@ -12,6 +12,8 @@ import shutil
|
||||
import salt.utils
|
||||
|
||||
# Import third party libs
|
||||
import salt.ext.six as six
|
||||
# pylint: disable=import-error
|
||||
try:
|
||||
import portage
|
||||
HAS_PORTAGE = True
|
||||
@ -27,6 +29,7 @@ except ImportError:
|
||||
HAS_PORTAGE = True
|
||||
except ImportError:
|
||||
pass
|
||||
# pylint: enable=import-error
|
||||
|
||||
|
||||
BASE_PATH = '/etc/portage/package.{0}'
|
||||
@ -220,11 +223,11 @@ def _merge_flags(*args):
|
||||
else:
|
||||
flags[flag] = True
|
||||
tmp = []
|
||||
for k, v in flags.items():
|
||||
if v:
|
||||
tmp.append(k)
|
||||
for key, val in six.iteritems(flags):
|
||||
if val:
|
||||
tmp.append(key)
|
||||
else:
|
||||
tmp.append('-' + k)
|
||||
tmp.append('-' + key)
|
||||
|
||||
# Next sort is just aesthetic, can be commented for a small performance
|
||||
# boost
|
||||
|
Loading…
Reference in New Issue
Block a user