Commit 01bf4663 authored by Soldatoff's avatar Soldatoff

изменил путь к yaml файлу. поправил под более старые версии питона

parent 5eb42b64
......@@ -3,7 +3,7 @@ Description=service for nginx-redirector
[Service]
Type=simple
ExecStart=/usr/bin/nginx-redirector-watch /EXAPLE/file.yaml
ExecStart=/usr/bin/nginx-redirector-watch /etc/nginx-redirector/config.yaml
WorkingDirectory=/usr/bin/
Restart=always
User=root
......
......@@ -15,7 +15,7 @@ class EqualRedirectorTest(unittest.TestCase):
abs_yaml_path = get_abs_path(CONFIG)
abs_test_path = get_abs_path('test.map')
abs_res_conf_path = get_rel_path(f"{CONFIG_DIR}/test.conf")
abs_res_conf_path = get_rel_path("{}/test.conf".format(CONFIG_DIR))
res_conf_file = open(abs_res_conf_path, 'r')
res_conf_lines = []
......@@ -28,9 +28,9 @@ class EqualRedirectorTest(unittest.TestCase):
maps_dir = get_rel_path(MAPS_DIR)
abs_res_map_paths = [
f"{maps_dir}/test.map",
f"{maps_dir}/test_permanent_options.map",
f"{maps_dir}/test_status=301_options.map"
"{}/test.map".format(maps_dir),
"{}/test_permanent_options.map".format(maps_dir),
"{}/test_status=301_options.map".format(maps_dir)
]
res_map_lines = []
......@@ -58,9 +58,9 @@ class EqualRedirectorTest(unittest.TestCase):
test_maps_dir = get_rel_path('nginx/maps')
abs_test_map_paths = [
f"{test_maps_dir}/test.map",
f"{test_maps_dir}/test_permanent_options.map",
f"{test_maps_dir}/test_status=301_options.map"
"{}/test.map".format(test_maps_dir),
"{}/test_permanent_options.map".format(test_maps_dir),
"{}/test_status=301_options.map".format(test_maps_dir)
]
test_map_lines = []
......
......@@ -17,7 +17,7 @@ class Generator:
maps_dir, config_dir = self.get_conf_dirs()
try:
with open(f"{maps_dir}/{project_name}.map", "w") as map_file:
with open("{}/{}.map".format(maps_dir,project_name), "w") as map_file:
map_file.write(redirects_map)
for code, data in redirects_with_options:
if code == "301":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment