mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
pre-commit fix
This commit is contained in:
parent
5b43f8f23d
commit
afa94e7227
1 changed files with 7 additions and 9 deletions
|
@ -69,14 +69,14 @@ def install(app_id, enable=True, tries=3, wait=10):
|
||||||
except sqlite3.Error as exc:
|
except sqlite3.Error as exc:
|
||||||
if "attempt to write a readonly database" not in str(exc):
|
if "attempt to write a readonly database" not in str(exc):
|
||||||
raise CommandExecutionError(
|
raise CommandExecutionError(
|
||||||
"Error installing app({}): {}".format(app_id, exc)
|
f"Error installing app({app_id}): {exc}"
|
||||||
)
|
)
|
||||||
elif num_tries < tries:
|
elif num_tries < tries:
|
||||||
time.sleep(wait)
|
time.sleep(wait)
|
||||||
num_tries += 1
|
num_tries += 1
|
||||||
else:
|
else:
|
||||||
raise CommandExecutionError(
|
raise CommandExecutionError(
|
||||||
"Error installing app({}): {}".format(app_id, exc)
|
f"Error installing app({app_id}): {exc}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ def installed(app_id):
|
||||||
return db.installed(app_id)
|
return db.installed(app_id)
|
||||||
except sqlite3.Error as exc:
|
except sqlite3.Error as exc:
|
||||||
raise CommandExecutionError(
|
raise CommandExecutionError(
|
||||||
"Error checking if app({}) is installed: {}".format(app_id, exc)
|
f"Error checking if app({app_id}) is installed: {exc}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ def enable_(app_id, enabled=True):
|
||||||
return db.disable(app_id)
|
return db.disable(app_id)
|
||||||
except sqlite3.Error as exc:
|
except sqlite3.Error as exc:
|
||||||
raise CommandExecutionError(
|
raise CommandExecutionError(
|
||||||
"Error setting enable to {} on app({}): {}".format(enabled, app_id, exc)
|
f"Error setting enable to {enabled} on app({app_id}): {exc}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ def enabled(app_id):
|
||||||
return db.enabled(app_id)
|
return db.enabled(app_id)
|
||||||
except sqlite3.Error as exc:
|
except sqlite3.Error as exc:
|
||||||
raise CommandExecutionError(
|
raise CommandExecutionError(
|
||||||
"Error checking if app({}) is enabled: {}".format(app_id, exc)
|
f"Error checking if app({app_id}) is enabled: {exc}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -175,9 +175,7 @@ def remove(app_id):
|
||||||
try:
|
try:
|
||||||
return db.remove(app_id)
|
return db.remove(app_id)
|
||||||
except sqlite3.Error as exc:
|
except sqlite3.Error as exc:
|
||||||
raise CommandExecutionError(
|
raise CommandExecutionError(f"Error removing app({app_id}): {exc}")
|
||||||
"Error removing app({}): {}".format(app_id, exc)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class TccDB:
|
class TccDB:
|
||||||
|
@ -205,7 +203,7 @@ class TccDB:
|
||||||
self.ge_bigsur_and_later = True
|
self.ge_bigsur_and_later = True
|
||||||
else:
|
else:
|
||||||
raise CommandExecutionError(
|
raise CommandExecutionError(
|
||||||
"TCC Database structure unknown for digest '{}'".format(digest)
|
f"TCC Database structure unknown for digest '{digest}'"
|
||||||
)
|
)
|
||||||
|
|
||||||
def _get_client_type(self, app_id):
|
def _get_client_type(self, app_id):
|
||||||
|
|
Loading…
Add table
Reference in a new issue