mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Split words with '-' in action name
This commit is contained in:
parent
bb027cd421
commit
2f0a08bc98
4 changed files with 8 additions and 8 deletions
|
@ -538,9 +538,9 @@ monitor:
|
|||
action: store_true
|
||||
|
||||
### monitor_updatestats()
|
||||
updatestats:
|
||||
update-stats:
|
||||
action_help: Update monitoring statistics
|
||||
api: POST /monitor/updatestats
|
||||
api: POST /monitor/update-stats
|
||||
arguments:
|
||||
period:
|
||||
help: Time period to update
|
||||
|
@ -550,9 +550,9 @@ monitor:
|
|||
- month
|
||||
|
||||
### monitor_showstats()
|
||||
showstats:
|
||||
show-stats:
|
||||
action_help: Show monitoring statistics
|
||||
api: GET /monitor/showstats
|
||||
api: GET /monitor/show-stats
|
||||
arguments:
|
||||
period:
|
||||
help: Time period to show
|
||||
|
|
|
@ -490,7 +490,7 @@ def parse_dict(action_map):
|
|||
# Set the action s related function
|
||||
parsers[category + '_' + action].set_defaults(
|
||||
func=str_to_func('yunohost_' + category + '.'
|
||||
+ category + '_' + action))
|
||||
+ category + '_' + action.replace('-', '_')))
|
||||
# Add arguments
|
||||
if 'arguments' in action_params:
|
||||
for arg_name, arg_params in action_params['arguments'].items():
|
||||
|
|
|
@ -244,7 +244,7 @@ def main():
|
|||
api.register(method, path, http_exec)
|
||||
api.register('OPTIONS', path, http_exec)
|
||||
action_dict[action_params['api']] = {
|
||||
'function': 'yunohost_'+ category +'.'+ category +'_'+ action,
|
||||
'function': 'yunohost_'+ category +'.'+ category +'_'+ action.replace('-', '_'),
|
||||
'help' : action_params['action_help']
|
||||
}
|
||||
if 'arguments' in action_params:
|
||||
|
|
|
@ -234,7 +234,7 @@ def monitor_system(units=None, human_readable=False):
|
|||
return result
|
||||
|
||||
|
||||
def monitor_updatestats(period):
|
||||
def monitor_update_stats(period):
|
||||
"""
|
||||
Update monitoring statistics
|
||||
|
||||
|
@ -317,7 +317,7 @@ def monitor_updatestats(period):
|
|||
_save_stats(stats, period)
|
||||
|
||||
|
||||
def monitor_showstats(period, date=None):
|
||||
def monitor_show_stats(period, date=None):
|
||||
"""
|
||||
Show monitoring statistics
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue