From 5a37171f733fa8c7326161cc49af3df0be5dfae4 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Thu, 14 Jul 2022 13:25:57 +0200 Subject: Added default values for pathnames. This allows one to simply run `./configure` and expect it to produce sane defaults for an install. Previously, without specifying `--prefix=...`, `make install` would simply fail, recommending to set `--prefix` or `DESTDIR`, but that recommendation was incomplete at best, since it didn't set many of the subdirs needed for a good organization. Setting `DESTDIR` was even worse, since that shouldn't even affect an installation (it is required to be transparent to the installation). /usr/local is the historic Unix standard path to use for installations from source made manually by the admin of the system. Some package managers (Homebrew, I'm looking specifically at you) have abused that path to install their things, but 1) it's not our fault that someone else incorrectly abuses that path (and they seem to be fixing it for newer archs; e.g., they started using /opt/homebrew for Apple Silicon), 2) there's no better path than /usr/local, 3) we still allow changing it for systems where this might not be the desired path (MacOS Intel with hombrew), and 4) it's _the standard_. See a related conversation with Ingo (OpenBSD maintainer): On 7/27/22 16:16, Ingo Schwarze wrote: > Hi Alejandro, [...] > > Alejandro Colomar wrote on Sun, Jul 24, 2022 at 07:07:18PM +0200: >> On 7/24/22 16:57, Ingo Schwarze wrote: >>> Alejandro Colomar wrote on Sun, Jul 24, 2022 at 01:20:46PM +0200: > >>>> /usr/local is for sysadmins to build from source; > >>> Doing that is *very* strongly discouraged on OpenBSD. > >> I guess that's why the directory was reused in the BSDs to install ports >> (probably ports were installed by the sysadmin there, and by extension, >> ports are now always installed there, but that's just a guess). > > Maybe. In any case, the practice of using /usr/local for packages > created from ports is significantly older than the recommendation > to refrain from using upstream "make install" outside the ports > framework. > > * The FreeBSD ports framework was started by Jordan Hubbard in 1993. > * The ports framework was ported from FreeBSD to OpenBSD > by Niklas Hallqvist in 1996. > * NetBSD pkgsrc was forked from FreeBSD ports by Alistair G. Crooks > and Hubert Feyrer in 1997. > > I failed to quickly find Jordan's original version, but rev. 1.1 > of /usr/ports/infrastructure/mk/bsd.port.mk in OpenBSD (dated Jun 3 > 22:47:10 1996 UTC) already said > > LOCALBASE ?= /usr/local > PREFIX ?= ${LOCALBASE} > [...] >> I had a discussion in NGINX Unit about it, and >> the decission for now has been: "support prefix=/usr/local for default >> manual installation through the Makefile, and let BSD users adjust to >> their preferred path". > > That's an *excellent* solution for the task, thanks for doing it > the right way. By setting PREFIX=/usr/local by default in the > upstream Makefile, you are minimizing the work for *BSD porters. > > The BSD ports frameworks will typically run the upstreak "make install" > with the variable DESTDIR set to a custom value, for example > > DESTDIR=/usr/ports/pobj/groff-1.23.0/fake-amd64 > > so if the upstream Makefile sets PREFIX=/usr/local , > that's perfect, everything gets installed to the right place > without an intervention by the person doing the porting. > > Of course, if the upstream Makefile would use some other PREFIX, > that would not be a huge obstacle. All we have to do in that case > is pass the option --prefix=/usr/local to the ./configure script, > or something equivalent if the software isn't using GNU configure. > >> We were concerned that we might get collisions >> with the BSD port also installing in /usr/local, but that's the least >> evil (and considering BSD users don't typically run `make install`, it's >> not so bad). > > It's not bad at all. It's perfect. > > Of course, if a user wants to install *without* the ports framework, > they have to provide their own --prefix. But that's not an issue > because it is easy to do, and installing without a port is discouraged > anyway. === Directory variables should never contain a trailing slash (I've learned that the hard way, where some things would break unexpectedly). Especially, make(1) is likely to have problems when things have double slashes or a trailing slash, since it treats filenames as text strings. I've removed the trailing slash from the prefix, and added it to the derivate variables just after the prefix. pkg-config(1) also expects directory variables to have no trailing slash. === I also removed the code that would set variables as depending on the prefix if they didn't start with a slash, because that is a rather non-obvious behavior, and things should not always depend on prefix, but other dirs such as $(runstatedir), so if we keep a similar behavior it would be very unreliable. Better keep variables intact if set, or use the default if unset. === Print the real defaults for ./configure --help, rather than the actual values. === I used a subdirectory under the standard /var/lib for NXT_STATE, instead of a homemade "state" dir that does the same thing. === Modified the Makefile to create some dirs that weren't being created, and also remove those that weren't being removed in uninstall, probably because someone forgot to add them. === Add new options for setting the new variables, and rename some to be consistent with the standard names. Keep the old ones at configuration time for compatibility, but mark them as deprecated. Don't keep the old ones at exec time. === A summary of the default config is: Unit configuration summary: bin directory: ............. "/usr/local/bin" sbin directory: ............ "/usr/local/sbin" lib directory: ............. "/usr/local/lib" include directory: ......... "/usr/local/include" man pages directory: ....... "/usr/local/share/man" modules directory: ......... "/usr/local/lib/unit/modules" state directory: ........... "/usr/local/var/lib/unit" tmp directory: ............. "/tmp" pid file: .................. "/usr/local/var/run/unit/unit.pid" log file: .................. "/usr/local/var/log/unit/unit.log" control API socket: ........ "unix:/usr/local/var/run/unit/control.unit.sock" Link: Link: Reviewed-by: Artem Konev Reviewed-by: Andrew Clayton Tested-by: Andrew Clayton Reviewed-by: Konstantin Pavlov Signed-off-by: Alejandro Colomar --- test/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/conftest.py') diff --git a/test/conftest.py b/test/conftest.py index 4a1aa7cc..b4951273 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -393,9 +393,9 @@ def unit_run(state_dir=None): unitd_args = [ unitd, '--no-daemon', - '--modules', + '--modulesdir', build_dir, - '--state', + '--libstatedir', state, '--pid', temp_dir + '/unit.pid', @@ -403,7 +403,7 @@ def unit_run(state_dir=None): temp_dir + '/unit.log', '--control', 'unix:' + temp_dir + '/control.unit.sock', - '--tmp', + '--tmpdir', temp_dir, ] -- cgit From 7934dcabbc3c2b585e8d3f8fcee7020ba26f1687 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Tue, 21 Feb 2023 17:21:29 +0000 Subject: Tests: switched to using f-strings. Previously, it was necessary to support older versions of Python for compatibility. F-strings were released in Python 3.6. Python 3.5 was marked as unsupported by the end of 2020, so now it's possible to start using f-strings safely for better readability and performance. --- test/conftest.py | 84 ++++++++++++++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 45 deletions(-) (limited to 'test/conftest.py') diff --git a/test/conftest.py b/test/conftest.py index b4951273..8944c6b3 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -107,7 +107,7 @@ def pytest_configure(config): option.current_dir = os.path.abspath( os.path.join(os.path.dirname(__file__), os.pardir) ) - option.test_dir = option.current_dir + '/test' + option.test_dir = f'{option.current_dir}/test' option.architecture = platform.architecture()[0] option.system = platform.system() @@ -148,8 +148,8 @@ def pytest_generate_tests(metafunc): for version in versions: option.generated_tests[ - metafunc.function.__name__ + '[{}]'.format(version) - ] = (type + ' ' + version) + f'{metafunc.function.__name__} [{version}]' + ] = f'{type} {version}' # take available module from option and generate tests for each version @@ -161,18 +161,17 @@ def pytest_generate_tests(metafunc): generate_tests(available_versions) elif prereq_version == 'any': - option.generated_tests[metafunc.function.__name__] = ( - type + ' ' + available_versions[0] - ) + option.generated_tests[ + metafunc.function.__name__ + ] = f'{type} {available_versions[0]}' elif callable(prereq_version): generate_tests(list(filter(prereq_version, available_versions))) else: raise ValueError( - """ -Unexpected prerequisite version "%s" for module "%s" in %s. -'all', 'any' or callable expected.""" - % (str(prereq_version), module, str(cls)) + f''' +Unexpected prerequisite version "{prereq_version}" for module "{module}" in +{cls}. 'all', 'any' or callable expected.''' ) @@ -225,7 +224,7 @@ def pytest_sessionstart(session): check_isolation() check_unix_abstract() - _clear_conf(unit['temp_dir'] + '/control.unit.sock') + _clear_conf(f'{unit["temp_dir"]}/control.unit.sock') unit_stop() @@ -244,7 +243,7 @@ def pytest_runtest_makereport(item, call): # set a report attribute for each phase of a call, which can # be "setup", "call", "teardown" - setattr(item, "rep_" + rep.when, rep) + setattr(item, f'rep_{rep.when}', rep) @pytest.fixture(scope='class', autouse=True) @@ -264,7 +263,7 @@ def check_prerequisites(request): missed.append(module) if missed: - pytest.skip('Unit has no ' + ', '.join(missed) + ' module(s)') + pytest.skip(f'Unit has no {", ".join(missed)} module(s)') # check features @@ -278,7 +277,7 @@ def check_prerequisites(request): missed.append(feature) if missed: - pytest.skip(', '.join(missed) + ' feature(s) not supported') + pytest.skip(f'{", ".join(missed)} feature(s) not supported') @pytest.fixture(autouse=True) @@ -316,7 +315,7 @@ def run(request): # clean temp_dir before the next test if not option.restart: - _clear_conf(unit['temp_dir'] + '/control.unit.sock', log=log) + _clear_conf(f'{unit["temp_dir"]}/control.unit.sock', log=log) if is_findmnt and not waitforunmount(unit['temp_dir'], timeout=600): exit('Could not unmount some filesystems in tmp dir.') @@ -374,8 +373,8 @@ def unit_run(state_dir=None): if not option.restart and 'unitd' in unit_instance: return unit_instance - build_dir = option.current_dir + '/build' - unitd = build_dir + '/unitd' + build_dir = f'{option.current_dir}/build' + unitd = f'{build_dir}/unitd' if not os.path.isfile(unitd): exit('Could not find unit') @@ -386,10 +385,12 @@ def unit_run(state_dir=None): if oct(stat.S_IMODE(os.stat(build_dir).st_mode)) != '0o777': public_dir(build_dir) - state = temp_dir + '/state' if state_dir is None else state_dir + state = f'{temp_dir}/state' if state_dir is None else state_dir if not os.path.isdir(state): os.mkdir(state) + control_sock = f'{temp_dir}/control.unit.sock' + unitd_args = [ unitd, '--no-daemon', @@ -398,11 +399,11 @@ def unit_run(state_dir=None): '--libstatedir', state, '--pid', - temp_dir + '/unit.pid', + f'{temp_dir}/unit.pid', '--log', - temp_dir + '/unit.log', + f'{temp_dir}/unit.log', '--control', - 'unix:' + temp_dir + '/control.unit.sock', + f'unix:{temp_dir}/control.unit.sock', '--tmpdir', temp_dir, ] @@ -410,26 +411,26 @@ def unit_run(state_dir=None): if option.user: unitd_args.extend(['--user', option.user]) - with open(temp_dir + '/unit.log', 'w') as log: + with open(f'{temp_dir}/unit.log', 'w') as log: unit_instance['process'] = subprocess.Popen(unitd_args, stderr=log) Log.temp_dir = temp_dir - if not waitforfiles(temp_dir + '/control.unit.sock'): + if not waitforfiles(control_sock): _print_log() exit('Could not start unit') unit_instance['temp_dir'] = temp_dir - unit_instance['control_sock'] = temp_dir + '/control.unit.sock' + unit_instance['control_sock'] = control_sock unit_instance['unitd'] = unitd option.temp_dir = temp_dir - with open(temp_dir + '/unit.pid', 'r') as f: + with open(f'{temp_dir}/unit.pid', 'r') as f: unit_instance['pid'] = f.read().rstrip() if state_dir is None: - _clear_conf(unit_instance['temp_dir'] + '/control.unit.sock') + _clear_conf(control_sock) _fds_info['main']['fds'] = _count_fds(unit_instance['pid']) @@ -473,7 +474,7 @@ def unit_stop(): try: retcode = p.wait(15) if retcode: - return 'Child process terminated with code ' + str(retcode) + return f'Child process terminated with code {retcode}' except KeyboardInterrupt: p.kill() @@ -518,7 +519,7 @@ def _check_alerts(*, log=None): def _print_log(log=None): path = Log.get_path() - print('Path to unit.log:\n' + path + '\n') + print(f'Path to unit.log:\n{path}\n') if option.print_log: os.set_blocking(sys.stdout.fileno(), True) @@ -551,11 +552,11 @@ def _clear_conf(sock, *, log=None): ).keys() except json.JSONDecodeError: - pytest.fail('Can\'t parse certificates list.') + pytest.fail("Can't parse certificates list.") for cert in certs: resp = http.delete( - url='/certificates/' + cert, + url=f'/certificates/{cert}', sock_type='unix', addr=sock, )['body'] @@ -595,17 +596,14 @@ def _check_processes(): out = [ l for l in out - if re.search(router_pid + r'\s+' + unit_pid + r'.*unit: router', l) - is None + if re.search(fr'{router_pid}\s+{unit_pid}.*unit: router', l) is None ] assert len(out) == 1, 'one router' out = [ l for l in out - if re.search( - controller_pid + r'\s+' + unit_pid + r'.*unit: controller', l - ) + if re.search(fr'{controller_pid}\s+{unit_pid}.*unit: controller', l) is None ] assert len(out) == 0, 'one controller' @@ -646,18 +644,16 @@ def _check_fds(*, log=None): ps['fds'] += fds_diff if not option.restart: - assert ps['pid'] == ps_pid, 'same pid %s' % name + assert ps['pid'] == ps_pid, f'same pid {name}' - assert fds_diff <= option.fds_threshold, ( - 'descriptors leak %s' % name - ) + assert fds_diff <= option.fds_threshold, f'descriptors leak {name}' else: ps['fds'] = _count_fds(ps['pid']) def _count_fds(pid): - procfile = '/proc/%s/fd' % pid + procfile = f'/proc/{pid}/fd' if os.path.isdir(procfile): return len(os.listdir(procfile)) @@ -712,14 +708,12 @@ def stop_processes(): def pid_by_name(name): output = subprocess.check_output(['ps', 'ax', '-O', 'ppid']).decode() - m = re.search( - r'\s*(\d+)\s*' + str(unit_instance['pid']) + r'.*' + name, output - ) + m = re.search(fr'\s*(\d+)\s*{unit_instance["pid"]}.*{name}', output) return None if m is None else m.group(1) def find_proc(name, ps_output): - return re.findall(str(unit_instance['pid']) + r'.*' + name, ps_output) + return re.findall(f'{unit_instance["pid"]}.*{name}', ps_output) @pytest.fixture() @@ -762,7 +756,7 @@ def unit_pid(request): def pytest_sessionfinish(session): if not option.restart and option.save_log: - print('Path to unit.log:\n' + Log.get_path() + '\n') + print(f'Path to unit.log:\n{Log.get_path()}\n') option.restart = True -- cgit From 4ed4283cffe86a9ec942e59a1f686fd8286b7398 Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Tue, 7 Mar 2023 14:47:39 +0000 Subject: Tests: _clear_temp_dir() function introduced. Also added temporary directory clearing after checking available modules to prevent garbage environment when tests start. --- test/conftest.py | 57 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 26 deletions(-) (limited to 'test/conftest.py') diff --git a/test/conftest.py b/test/conftest.py index 8944c6b3..5dc92fa2 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -232,6 +232,8 @@ def pytest_sessionstart(session): if option.restart: shutil.rmtree(unit_instance['temp_dir']) + else: + _clear_temp_dir() @pytest.hookimpl(tryfirst=True, hookwrapper=True) @@ -316,32 +318,7 @@ def run(request): if not option.restart: _clear_conf(f'{unit["temp_dir"]}/control.unit.sock', log=log) - - if is_findmnt and not waitforunmount(unit['temp_dir'], timeout=600): - exit('Could not unmount some filesystems in tmp dir.') - - for item in os.listdir(unit['temp_dir']): - if item not in [ - 'control.unit.sock', - 'state', - 'unit.pid', - 'unit.log', - ]: - path = os.path.join(unit['temp_dir'], item) - - public_dir(path) - - if os.path.isfile(path) or stat.S_ISSOCK(os.stat(path).st_mode): - os.remove(path) - else: - for attempt in range(10): - try: - shutil.rmtree(path) - break - except OSError as err: - if err.errno != 16: - raise - time.sleep(1) + _clear_temp_dir() # check descriptors @@ -564,6 +541,34 @@ def _clear_conf(sock, *, log=None): assert 'success' in resp, 'remove certificate' +def _clear_temp_dir(): + temp_dir = unit_instance['temp_dir'] + + if is_findmnt and not waitforunmount(temp_dir, timeout=600): + exit('Could not unmount some filesystems in tmpdir ({temp_dir}).') + + for item in os.listdir(temp_dir): + if item not in [ + 'control.unit.sock', + 'state', + 'unit.pid', + 'unit.log', + ]: + path = os.path.join(temp_dir, item) + public_dir(path) + if os.path.isfile(path) or stat.S_ISSOCK(os.stat(path).st_mode): + os.remove(path) + else: + for attempt in range(10): + try: + shutil.rmtree(path) + break + except OSError as err: + if err.errno != 16: + raise + time.sleep(1) + + def _check_processes(): router_pid = _fds_info['router']['pid'] controller_pid = _fds_info['controller']['pid'] -- cgit From 5ba79b9b524ef746bc3269520c3f6b893f39275c Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 27 Mar 2023 13:43:37 +0200 Subject: Renamed --libstatedir to --statedir. In BSD systems, it's usually or some other dir under that is not , so $statedir is a more generic name. See hier(7). Reported-by: Andrei Zeliankou Reported-by: Zhidao Hong Reviewed-by: Konstantin Pavlov Reviewed-by: Andrew Clayton Cc: Liam Crilly Signed-off-by: Alejandro Colomar --- test/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/conftest.py') diff --git a/test/conftest.py b/test/conftest.py index 5dc92fa2..06d63389 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -373,7 +373,7 @@ def unit_run(state_dir=None): '--no-daemon', '--modulesdir', build_dir, - '--libstatedir', + '--statedir', state, '--pid', f'{temp_dir}/unit.pid', -- cgit From 6e16d7ac5bb86140a55ea30a35c69ee0df3eff8d Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 22 Mar 2023 16:55:02 +0100 Subject: Auto: mirroring installation structure in build tree. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the build tree more organized, which is good for adding new stuff. Now, it's useful for example for adding manual pages in man3/, but it may be useful in the future for example for extending the build system to run linters (e.g., clang-tidy(1), Clang analyzer, ...) on the C source code. Previously, the build tree was quite flat, and looked like this (after `./configure && make`): $ tree -I src build build ├── Makefile ├── autoconf.data ├── autoconf.err ├── echo ├── libnxt.a ├── nxt_auto_config.h ├── nxt_version.h ├── unitd └── unitd.8 1 directory, 9 files And after this patch, it looks like this: $ tree -I src build build ├── Makefile ├── autoconf.data ├── autoconf.err ├── bin │ └── echo ├── include │ ├── nxt_auto_config.h │ └── nxt_version.h ├── lib │ ├── libnxt.a │ └── unit │ └── modules ├── sbin │ └── unitd ├── share │ └── man │ └── man8 │ └── unitd.8 └── var ├── lib │ └── unit ├── log │ └── unit └── run └── unit 17 directories, 9 files It also solves one issue introduced in 5a37171f733f ("Added default values for pathnames."). Before that commit, it was possible to run unitd from the build system (`./build/unitd`). Now, since it expects files in a very specific location, that has been broken. By having a directory structure that mirrors the installation, it's possible to trick it to believe it's installed, and run it from there: $ ./configure --prefix=./build $ make $ ./build/sbin/unitd Fixes: 5a37171f733f ("Added default values for pathnames.") Reported-by: Liam Crilly Reviewed-by: Konstantin Pavlov Reviewed-by: Andrew Clayton Cc: Andrei Zeliankou Cc: Zhidao Hong Signed-off-by: Alejandro Colomar --- test/conftest.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'test/conftest.py') diff --git a/test/conftest.py b/test/conftest.py index 06d63389..6d8e59fd 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -350,8 +350,11 @@ def unit_run(state_dir=None): if not option.restart and 'unitd' in unit_instance: return unit_instance - build_dir = f'{option.current_dir}/build' - unitd = f'{build_dir}/unitd' + builddir = f'{option.current_dir}/build' + libdir = f'{builddir}/lib' + modulesdir = f'{libdir}/unit/modules' + sbindir = f'{builddir}/sbin' + unitd = f'{sbindir}/unitd' if not os.path.isfile(unitd): exit('Could not find unit') @@ -359,12 +362,12 @@ def unit_run(state_dir=None): temp_dir = tempfile.mkdtemp(prefix='unit-test-') public_dir(temp_dir) - if oct(stat.S_IMODE(os.stat(build_dir).st_mode)) != '0o777': - public_dir(build_dir) + if oct(stat.S_IMODE(os.stat(builddir).st_mode)) != '0o777': + public_dir(builddir) - state = f'{temp_dir}/state' if state_dir is None else state_dir - if not os.path.isdir(state): - os.mkdir(state) + statedir = f'{temp_dir}/state' if state_dir is None else state_dir + if not os.path.isdir(statedir): + os.mkdir(statedir) control_sock = f'{temp_dir}/control.unit.sock' @@ -372,9 +375,9 @@ def unit_run(state_dir=None): unitd, '--no-daemon', '--modulesdir', - build_dir, + modulesdir, '--statedir', - state, + statedir, '--pid', f'{temp_dir}/unit.pid', '--log', -- cgit From e88e16d11e8d197f27d292540a015cf05af6277f Mon Sep 17 00:00:00 2001 From: Andrei Zeliankou Date: Wed, 10 May 2023 13:02:52 +0100 Subject: Tests: added tests for NJS loadable modules. --- test/conftest.py | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'test/conftest.py') diff --git a/test/conftest.py b/test/conftest.py index 6d8e59fd..926d83f8 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -523,26 +523,31 @@ def _clear_conf(sock, *, log=None): assert 'success' in resp, 'clear conf' - if 'openssl' not in option.available['modules']: - return + def get(url): + return http.get(url=url, sock_type='unix', addr=sock)['body'] - try: - certs = json.loads( - http.get(url='/certificates', sock_type='unix', addr=sock)['body'] - ).keys() + def delete(url): + return http.delete(url=url, sock_type='unix', addr=sock)['body'] + + if 'openssl' in option.available['modules']: + try: + certs = json.loads(get('/certificates')).keys() + + except json.JSONDecodeError: + pytest.fail("Can't parse certificates list.") - except json.JSONDecodeError: - pytest.fail("Can't parse certificates list.") + for cert in certs: + assert 'success' in delete(f'/certificates/{cert}'), 'delete cert' - for cert in certs: - resp = http.delete( - url=f'/certificates/{cert}', - sock_type='unix', - addr=sock, - )['body'] + if 'njs' in option.available['modules']: + try: + scripts = json.loads(get('/js_modules')).keys() - assert 'success' in resp, 'remove certificate' + except json.JSONDecodeError: + pytest.fail("Can't parse njs modules list.") + for script in scripts: + assert 'success' in delete(f'/js_modules/{script}'), 'delete script' def _clear_temp_dir(): temp_dir = unit_instance['temp_dir'] -- cgit