Repository navigation
Description
Hi,
I'm not sure if this is expected behavior or a bug.
###############################
{
"name": "Select seftware to set",
"param": "-b",
"type": "list",
"default": "networkaudiod",
"values": [
"networkaudiod",
"squeezelite-R2",
"squeezelite"
],
"description": "Select seftware to set"
},
{
"name": "Set affinity",
"param": "-c",
"type": "text",
"default": {
"script": "/opt/.gentooplayer/web/scripts/script/expert1/${Select seftware to set}/affinity.sh"
},
"description": "Set CPU affinity"
},
################################
2020-07-12 07:27:23,794 [root.INFO] Starting GentooPlayer, v1.16.0-master@995fec1
2020-07-12 07:27:23,811 [asyncio.DEBUG] Using selector: EpollSelector
Server is running on: http://0.0.0.0:5000
2020-07-12 07:27:27,678 [identification.INFO] Assigned user_id=192.168.178.22-6d9fb38bcbd547e6 to {'ip': '192.168.178.22', 'hostname': 'GentooServer.fritz.box'}
2020-07-12 07:27:27,719 [tornado.access.INFO] 304 GET /index.html (192.168.178.22) 45.99ms
2020-07-12 07:27:27,748 [tornado.access.INFO] 304 GET /css/chunk-index-vendors.47bd9eac.css (192.168.178.22) 3.77ms
2020-07-12 07:27:27,758 [tornado.access.INFO] 304 GET /css/index.00b840dd.css (192.168.178.22) 7.60ms
2020-07-12 07:27:27,763 [tornado.access.INFO] 304 GET /js/chunk-index-vendors.3dee9c44.js (192.168.178.22) 10.09ms
2020-07-12 07:27:27,766 [tornado.access.INFO] 304 GET /js/index.807c7662.js (192.168.178.22) 11.71ms
2020-07-12 07:27:27,800 [tornado.access.INFO] 304 GET /favicon.ico (192.168.178.22) 3.14ms
2020-07-12 07:27:27,836 [tornado.access.INFO] 304 GET /img/titleBackground_small.8d99a14e.jpg (192.168.178.22) 3.40ms
2020-07-12 07:27:27,842 [tornado.access.INFO] 304 GET /executions/active (192.168.178.22) 3.13ms
2020-07-12 07:27:27,847 [tornado.access.INFO] 304 GET /auth/info (192.168.178.22) 4.36ms
2020-07-12 07:27:27,849 [tornado.access.INFO] 304 GET /conf (192.168.178.22) 5.11ms
2020-07-12 07:27:27,880 [tornado.access.INFO] 304 GET /scripts (192.168.178.22) 35.12ms
2020-07-12 07:27:27,895 [tornado.access.INFO] 101 GET /scripts/Set%20software (192.168.178.22) 3.91ms
2020-07-12 07:27:27,947 [web_server.ERROR] Failed to load script config Set software
Traceback (most recent call last):
File "src/web/server.py", line 268, in open
self.config_model = yield load_config_future
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "src/config/config_service.py", line 124, in load_config_model
return self._load_script_config(path, json_object, user, parameter_values)
File "src/config/config_service.py", line 188, in _load_script_config
parameter_values=parameter_values)
File "src/model/script_config.py", line 66, in init
self._init_parameters(username, audit_name)
File "src/model/script_config.py", line 139, in _init_parameters
self.working_directory)
File "src/model/parameter_config.py", line 54, in init
self._reload()
File "src/model/parameter_config.py", line 74, in _reload
self.default = _resolve_default(config.get('default'), self._username, self._audit_name, self._working_dir)
File "src/model/parameter_config.py", line 419, in _resolve_default
output = process_utils.invoke(resolved_string_value, working_dir)
File "src/utils/process_utils.py", line 27, in invoke
universal_newlines=True)
File "/usr/lib/python3.7/subprocess.py", line 800, in init
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/.gentooplayer/web/scripts/script/expert1/${Select': '/opt/.gentooplayer/web/scripts/script/expert1/${Select'
Activity
bugy commentedon Jul 12, 2020
antonellocaroli commentedon Jul 12, 2020
no, it's not working.
and it doesn't work changing like that either:
#################
{
"name": "Select seftware to set",
"param": "-b",
"type": "list",
"default": "networkaudiod",
"values": [
"networkaudiod",
"squeezelite-R2",
"squeezelite"
],
"description": "Select seftware to set"
},
{
"name": "Set affinity",
"param": "-c",
"type": "text",
"default": {
"script": "/opt/.gentooplayer/web/scripts/script/expert1/software/affinity.sh ${Select seftware to set}"
},
"description": "Set CPU affinity"
},
####################
2020-07-12 09:17:37,436 [tornado.access.INFO] 101 GET /scripts/Set%20software (192.168.178.22) 3.94ms
2020-07-12 09:17:37,494 [web_server.ERROR] Failed to load script config Set software
Traceback (most recent call last):
File "src/web/server.py", line 268, in open
self.config_model = yield load_config_future
File "/usr/lib/python3.7/site-packages/tornado/gen.py", line 735, in run
value = future.result()
File "/usr/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "src/config/config_service.py", line 124, in load_config_model
return self._load_script_config(path, json_object, user, parameter_values)
File "src/config/config_service.py", line 188, in _load_script_config
parameter_values=parameter_values)
File "src/model/script_config.py", line 66, in init
self._init_parameters(username, audit_name)
File "src/model/script_config.py", line 139, in _init_parameters
self.working_directory)
File "src/model/parameter_config.py", line 54, in init
self._reload()
File "src/model/parameter_config.py", line 74, in _reload
self.default = _resolve_default(config.get('default'), self._username, self._audit_name, self._working_dir)
File "src/model/parameter_config.py", line 419, in _resolve_default
output = process_utils.invoke(resolved_string_value, working_dir)
File "src/utils/process_utils.py", line 33, in invoke
raise ExecutionException(result_code, error, output)
utils.process_utils.ExecutionException: Execution failed. Code 127: /opt/.gentooplayer/web/scripts/script/expert1/software/affinity.sh: line 3: /opt/.gentooplayer/web/scripts/script/expert1/${Select/affinity.sh: No such file or directory
bugy commentedon Jul 13, 2020
antonellocaroli commentedon Jul 13, 2020
ok, but how do I calculate a certain value based on the first parameter chosen? I can't find a solution...
bugy commentedon Jul 13, 2020
#320 added support for dynamic "default" option, depending on other p…
bugy commentedon Mar 16, 2023
Fixed, now parameters can be specified in "default" section. A new default value will override the existing value in 2 of the cases:
In other words, if a user modifies a value manually, the new default value will be ignored.
antonellocaroli commentedon Mar 17, 2023
Thank you @bugy ,
works perfectly.
I have 5 parameters that change according to the choice of parameter 1.
Only one parameter does not update, it only updates if I refresh the page, or if I wait a while, maybe it's a timing issue.
Is there any way to force the page to refresh at the end of the execution of the script in question?
bugy commentedon Mar 17, 2023
Hi @antonellocaroli thanks for the feedback, could you share a simple sample script for me, so I can reproduce the issue locally?
Regarding forced page refresh, unfortunately, this is not possible. What is the use case? Are some parameters relying on values, which are changed by script during the execution?
antonellocaroli commentedon Mar 17, 2023
@bugy do you have the possibility to make a live connection with teamviewer? i'll show you directly.
if yes, write me at antonellocaroli@gmail.com and i will send you the teamviewer credentials..
bugy commentedon Mar 17, 2023
To be honest, I would prefer a script, so I can debug it locally in IDE. Just seeing it is not very helpful
antonellocaroli commentedon Mar 17, 2023
I sent you an e-mail
#320 fixed missing observable notifications in case of an exception +…