Skip to content

Commit

Permalink
passing pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Akm0d authored and dwoz committed Oct 7, 2020
1 parent f909cb5 commit cfca39c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions salt/utils/decorators/state.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
# -*- coding: utf-8 -*-
"""
Decorators for salt.state
:codeauthor: :email:`Bo Maryniuk (bo@suse.de)`
"""

# Import Python libs
from __future__ import absolute_import, unicode_literals

import logging

# Import salt libs
import salt.utils.stringutils
from salt.exceptions import SaltException

log = logging.getLogger(__name__)


class OutputUnifier(object):
class OutputUnifier:
def __init__(self, *policies):
self.policies = []
for pls in policies:
if not hasattr(self, pls):
raise SaltException("Unknown policy: {0}".format(pls))
raise SaltException("Unknown policy: {}".format(pls))
else:
self.policies.append(getattr(self, pls))

Expand All @@ -40,7 +36,7 @@ def _run_policies(self, data):
"result": False,
"name": "later",
"changes": {},
"comment": "An exception occurred in this state: {0}".format(exc),
"comment": "An exception occurred in this state: {}".format(exc),
}
return data

Expand Down Expand Up @@ -78,7 +74,7 @@ def content_check(self, result):
if val not in result:
missing.append(val)
if missing:
err_msg = "The following keys were not present in the state return: {0}.".format(
err_msg = "The following keys were not present in the state return: {}.".format(
", ".join(missing)
)
else:
Expand Down

0 comments on commit cfca39c

Please sign in to comment.