diff --git a/tower/api/service.py b/tower/api/service.py index e9d2faf620c3e0a2ec17440c941eef998dd4c435..3403b4bd782246ca60ffbdd232855e9690f1b543 100644 --- a/tower/api/service.py +++ b/tower/api/service.py @@ -34,7 +34,7 @@ class ServiceAPI(API): if not os.path.exists(path): continue with open(path) as f: - descr = yaml.load(f, OrderedDictYAMLLoader) + descr = yaml.full_load(f, OrderedDictYAMLLoader) if not descr: continue if "services" not in descr or not descr["services"]: diff --git a/tower/migrations/024_change_session_timeout.py b/tower/migrations/024_change_session_timeout.py index 2c7258024ce53a94991b82b258066b0856f50560..a02b4912b8c614986f9caca77b9a714a244d7af5 100644 --- a/tower/migrations/024_change_session_timeout.py +++ b/tower/migrations/024_change_session_timeout.py @@ -71,7 +71,7 @@ def migrate(migrator): is_default = BooleanField(default=False) for env in Environment.select(): - config = yaml.load(env.service_config) + config = yaml.full_load(env.service_config) if "session_ttl" in config[None]["login"]: if "d" not in str(config[None]["login"]["session_ttl"]): config[None]["login"]["session_ttl"] = str(config[None]["login"]["session_ttl"]) + "d" diff --git a/tower/migrations/030_move_db_settings.py b/tower/migrations/030_move_db_settings.py index 0472350301e9ef5a1485d18d8b9990ca327e87ed..eba7aedbc6c585866c60bf10b1610b81acef8e61 100644 --- a/tower/migrations/030_move_db_settings.py +++ b/tower/migrations/030_move_db_settings.py @@ -73,7 +73,7 @@ def migrate(migrator): if len(Environment.select()) != 0: for env in Environment.select(): print("Migrating %s" % env.name) - config = yaml.load(env.service_config) + config = yaml.full_load(env.service_config) if not config: continue config[None]["influxdb"] = { diff --git a/tower/migrations/032_add_default_roles.py b/tower/migrations/032_add_default_roles.py index d23f3e6a736c43e28f25f7fbe0a9ba1099e04601..733dc16bbeb0b709d8099b3c4e21f195c6075d1f 100644 --- a/tower/migrations/032_add_default_roles.py +++ b/tower/migrations/032_add_default_roles.py @@ -152,7 +152,7 @@ def migrate(migrator): loglevel="info" ).save() # Adjust service config - config = yaml.load(env.service_config) or {None: {}} + config = yaml.full_load(env.service_config) or {None: {}} config[None]["telegraf"] = { "telegraf_output_plugin": "influx" } diff --git a/tower/migrations/033_remove_custom.py b/tower/migrations/033_remove_custom.py index e275f2487a8c7242e53dd07d8c9812cd67a74853..5d0768caea22b5998ca31dbf48d0a8efcff610c8 100644 --- a/tower/migrations/033_remove_custom.py +++ b/tower/migrations/033_remove_custom.py @@ -35,7 +35,7 @@ def migrate(migrator): if len(Environment.select()) != 0: for env in Environment.select(): print("Migrating %s" % env.name) - config = yaml.load(env.service_config) + config = yaml.full_load(env.service_config) if not config: continue if env.custom_repo: diff --git a/tower/migrations/034_service_config.py b/tower/migrations/034_service_config.py index 29e4a115292e1e4d66aee31b05efe1113b50f856..2b256343399ed520d691cab3646d5cec3f48dd57 100644 --- a/tower/migrations/034_service_config.py +++ b/tower/migrations/034_service_config.py @@ -58,7 +58,7 @@ def migrate(migrator): print("Migrating %s" % env.name) # remove nodes without services - config = yaml.load(env.service_config) + config = yaml.full_load(env.service_config) if not config: continue # move settings from environment to service diff --git a/tower/models/environment.py b/tower/models/environment.py index 8752055947888b32038b1e277cec2ea3a743ef97..52458b34ce253d96740238cb9642bac42f4bc184 100644 --- a/tower/models/environment.py +++ b/tower/models/environment.py @@ -415,7 +415,7 @@ class Environment(Model): if not os.path.exists(path): continue with open(path) as f: - descr = yaml.load(f) + descr = yaml.full_load(f) if not descr: continue if "services" not in descr or not descr["services"]: diff --git a/tower/models/service.py b/tower/models/service.py index b422438d1c94e6dbd492263b41891a159ccb20da..5aca41d9dc1fbdcd9a49c8b40ac549b406e15672 100644 --- a/tower/models/service.py +++ b/tower/models/service.py @@ -45,7 +45,7 @@ class Service(Model): if not os.path.exists(path): continue with open(path) as f: - descr = yaml.load(f) + descr = yaml.full_load(f) if not descr: continue for srv in sorted(descr["services"]):