Skip to content

Commit afa94e7

Browse files
committed
pre-commit fix
1 parent 5b43f8f commit afa94e7

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

salt/modules/mac_assistive.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ def install(app_id, enable=True, tries=3, wait=10):
6969
except sqlite3.Error as exc:
7070
if "attempt to write a readonly database" not in str(exc):
7171
raise CommandExecutionError(
72-
"Error installing app({}): {}".format(app_id, exc)
72+
f"Error installing app({app_id}): {exc}"
7373
)
7474
elif num_tries < tries:
7575
time.sleep(wait)
7676
num_tries += 1
7777
else:
7878
raise CommandExecutionError(
79-
"Error installing app({}): {}".format(app_id, exc)
79+
f"Error installing app({app_id}): {exc}"
8080
)
8181

8282

@@ -100,7 +100,7 @@ def installed(app_id):
100100
return db.installed(app_id)
101101
except sqlite3.Error as exc:
102102
raise CommandExecutionError(
103-
"Error checking if app({}) is installed: {}".format(app_id, exc)
103+
f"Error checking if app({app_id}) is installed: {exc}"
104104
)
105105

106106

@@ -129,7 +129,7 @@ def enable_(app_id, enabled=True):
129129
return db.disable(app_id)
130130
except sqlite3.Error as exc:
131131
raise CommandExecutionError(
132-
"Error setting enable to {} on app({}): {}".format(enabled, app_id, exc)
132+
f"Error setting enable to {enabled} on app({app_id}): {exc}"
133133
)
134134

135135

@@ -153,7 +153,7 @@ def enabled(app_id):
153153
return db.enabled(app_id)
154154
except sqlite3.Error as exc:
155155
raise CommandExecutionError(
156-
"Error checking if app({}) is enabled: {}".format(app_id, exc)
156+
f"Error checking if app({app_id}) is enabled: {exc}"
157157
)
158158

159159

@@ -175,9 +175,7 @@ def remove(app_id):
175175
try:
176176
return db.remove(app_id)
177177
except sqlite3.Error as exc:
178-
raise CommandExecutionError(
179-
"Error removing app({}): {}".format(app_id, exc)
180-
)
178+
raise CommandExecutionError(f"Error removing app({app_id}): {exc}")
181179

182180

183181
class TccDB:
@@ -205,7 +203,7 @@ def _check_table_digest(self):
205203
self.ge_bigsur_and_later = True
206204
else:
207205
raise CommandExecutionError(
208-
"TCC Database structure unknown for digest '{}'".format(digest)
206+
f"TCC Database structure unknown for digest '{digest}'"
209207
)
210208

211209
def _get_client_type(self, app_id):

0 commit comments

Comments
 (0)