mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Lint py files
This commit is contained in:
parent
656c5008de
commit
47bf7299a1
5 changed files with 35 additions and 10 deletions
|
|
@ -63,8 +63,7 @@ class Config(ConfigCaller):
|
|||
"instances": False,
|
||||
"services": False,
|
||||
"configs": False,
|
||||
"config": False
|
||||
|
||||
"config": False,
|
||||
}
|
||||
changes = []
|
||||
if instances != self.__instances or first:
|
||||
|
|
@ -142,7 +141,9 @@ class Config(ConfigCaller):
|
|||
)
|
||||
# save custom configs to database
|
||||
if updates["configs"]:
|
||||
err = self._db.save_custom_configs(custom_configs, "autoconf", changed=False)
|
||||
err = self._db.save_custom_configs(
|
||||
custom_configs, "autoconf", changed=False
|
||||
)
|
||||
if err:
|
||||
success = False
|
||||
self.__logger.error(
|
||||
|
|
|
|||
|
|
@ -106,7 +106,12 @@ class DockerController(Controller):
|
|||
return configs
|
||||
|
||||
def apply_config(self) -> bool:
|
||||
return self.apply(self._instances, self._services, configs=self._configs, first=not self._loaded)
|
||||
return self.apply(
|
||||
self._instances,
|
||||
self._services,
|
||||
configs=self._configs,
|
||||
first=not self._loaded,
|
||||
)
|
||||
|
||||
def process_events(self):
|
||||
self._set_autoconf_load_db()
|
||||
|
|
|
|||
|
|
@ -298,7 +298,12 @@ class IngressController(Controller):
|
|||
sleep(10)
|
||||
|
||||
def apply_config(self) -> bool:
|
||||
return self.apply(self._instances, self._services, configs=self._configs, first=not self._loaded)
|
||||
return self.apply(
|
||||
self._instances,
|
||||
self._services,
|
||||
configs=self._configs,
|
||||
first=not self._loaded,
|
||||
)
|
||||
|
||||
def process_events(self):
|
||||
self._set_autoconf_load_db()
|
||||
|
|
|
|||
|
|
@ -127,7 +127,12 @@ class SwarmController(Controller):
|
|||
return configs
|
||||
|
||||
def apply_config(self) -> bool:
|
||||
return self.apply(self._instances, self._services, configs=self._configs, first=not self._loaded)
|
||||
return self.apply(
|
||||
self._instances,
|
||||
self._services,
|
||||
configs=self._configs,
|
||||
first=not self._loaded,
|
||||
)
|
||||
|
||||
def __event(self, event_type):
|
||||
while True:
|
||||
|
|
|
|||
|
|
@ -329,7 +329,9 @@ class Database:
|
|||
except BaseException:
|
||||
return format_exc()
|
||||
|
||||
def checked_changes(self, changes: Optional[List[str]] = None, value: Optional[bool] = False) -> str:
|
||||
def checked_changes(
|
||||
self, changes: Optional[List[str]] = None, value: Optional[bool] = False
|
||||
) -> str:
|
||||
"""Set changed bit for config, custom configs, instances and plugins"""
|
||||
changes = changes or [
|
||||
"config",
|
||||
|
|
@ -470,7 +472,9 @@ class Database:
|
|||
|
||||
return True, ""
|
||||
|
||||
def save_config(self, config: Dict[str, Any], method: str, changed: Optional[bool] = True) -> str:
|
||||
def save_config(
|
||||
self, config: Dict[str, Any], method: str, changed: Optional[bool] = True
|
||||
) -> str:
|
||||
"""Save the config in the database"""
|
||||
to_put = []
|
||||
with self.__db_session() as session:
|
||||
|
|
@ -733,7 +737,10 @@ class Database:
|
|||
return ""
|
||||
|
||||
def save_custom_configs(
|
||||
self, custom_configs: List[Dict[str, Tuple[str, List[str]]]], method: str, changed: Optional[bool] = True
|
||||
self,
|
||||
custom_configs: List[Dict[str, Tuple[str, List[str]]]],
|
||||
method: str,
|
||||
changed: Optional[bool] = True,
|
||||
) -> str:
|
||||
"""Save the custom configs in the database"""
|
||||
message = ""
|
||||
|
|
@ -1750,7 +1757,9 @@ class Database:
|
|||
|
||||
return ""
|
||||
|
||||
def update_instances(self, instances: List[Dict[str, Any]], changed: Optional[bool] = True) -> str:
|
||||
def update_instances(
|
||||
self, instances: List[Dict[str, Any]], changed: Optional[bool] = True
|
||||
) -> str:
|
||||
"""Update instances."""
|
||||
to_put = []
|
||||
with self.__db_session() as session:
|
||||
|
|
|
|||
Loading…
Reference in a new issue