|
4 | 4 | import subprocess |
5 | 5 |
|
6 | 6 | import kolibri.utils.pskolibri as psutil |
7 | | - |
8 | | -from kolibri.core.content.utils.paths import get_content_dir_path |
9 | 7 | from kolibri.core.utils.cache import RedisSettingsHelper |
10 | 8 | from kolibri.core.utils.cache import process_cache |
11 | | -from kolibri.utils.options import update_options_file |
12 | | -from kolibri.utils.conf import OPTIONS |
13 | 9 | from kolibri.utils.conf import KOLIBRI_HOME |
| 10 | +from kolibri.utils.conf import OPTIONS |
| 11 | +from kolibri.utils.options import update_options_file |
14 | 12 |
|
15 | 13 | # read the config file options |
16 | 14 | port = OPTIONS["Deployment"]["HTTP_PORT"] |
@@ -64,12 +62,14 @@ def set_port(port): |
64 | 62 | """ |
65 | 63 | update_options_file("Deployment", "HTTP_PORT", port) |
66 | 64 |
|
| 65 | + |
67 | 66 | def set_zip_content_port(port): |
68 | 67 | """ |
69 | 68 | Modify Kolibri options to set the TCP port the hashi files will be served on |
70 | 69 | """ |
71 | 70 | update_options_file("Deployment", "ZIP_CONTENT_PORT", port) |
72 | 71 |
|
| 72 | + |
73 | 73 | def delete_redis_cache(): |
74 | 74 | """ |
75 | 75 | Delete previous cache in redis to reset it when the service starts. |
@@ -141,7 +141,7 @@ def check_redis_service(): |
141 | 141 |
|
142 | 142 | def save_nginx_conf_port(port, zip_port, listen_address="0.0.0.0", nginx_conf=None): |
143 | 143 | """ |
144 | | - Adds the port for nginx to run to an existing config file. |
| 144 | + Adds the port for nginx to run to an existing config file. |
145 | 145 | """ |
146 | 146 |
|
147 | 147 | if nginx_conf is None: |
@@ -210,9 +210,7 @@ def save_nginx_conf_port(port, zip_port, listen_address="0.0.0.0", nginx_conf=No |
210 | 210 | help="Port to run hashi iframes used when installing/reconfiguring kolibri-server package", |
211 | 211 | ) |
212 | 212 | args = parser.parse_args() |
213 | | - if ( |
214 | | - args.debconfport |
215 | | - ): # To be executed only when installing/reconfiguring the Debian package |
| 213 | + if args.debconfport: # To be executed only when installing/reconfiguring the Debian package |
216 | 214 | set_port(args.debconfport) |
217 | 215 | if args.debconfzipport: |
218 | 216 | set_zip_content_port(args.debconfzipport) |
|
0 commit comments