-
-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default value and variable error #320
Comments
I think it's more like a bug. But could you try wrapiing the variable in
double quotes:
"${Select software}"
antonellocaroli <[email protected]> schrieb am So., 12. Juli 2020,
07:30:
… 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,
***@***.***
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'
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#320>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJXPJLP4RKPUHOR3QGJ5M3R3FC7JANCNFSM4OXUMECQ>
.
|
no, it's not working. and it doesn't work changing like that either: ################# |
Hi, variables are not supported in `default` field. Only authentication
parameters.
Default fields are initialized at script load time, so base them on
variables doesnt make much sense
antonellocaroli <[email protected]> schrieb am So., 12. Juli 2020,
09:19:
… 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
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#320 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJXPJNSO72VBWHJC5QSUWDR3FPZVANCNFSM4OXUMECQ>
.
|
ok, but how do I calculate a certain value based on the first parameter chosen? I can't find a solution... |
I'm afraid it's not possible :(
antonellocaroli <[email protected]> schrieb am Mo., 13. Juli 2020,
18:38:
… ok, but how do I calculate a certain value based on the first parameter
chosen? I can't find a solution...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#320 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJXPJJLAKRHVC4APQSRVUDR3MZ7HANCNFSM4OXUMECQ>
.
|
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. |
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? |
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? |
@bugy do you have the possibility to make a live connection with teamviewer? i'll show you directly. if yes, write me at [email protected] and i will send you the teamviewer credentials.. |
To be honest, I would prefer a script, so I can debug it locally in IDE. Just seeing it is not very helpful |
I sent you an e-mail |
… fixed swallowing a websocket future exception
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'
The text was updated successfully, but these errors were encountered: