You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
3.0 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016 Mir Calculate. http://www.calculate-linux.org
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. import sys
  16. from calculate.lib.datavars import VariableError, DataVarsError
  17. from calculate.core.server.func import WsdlBase
  18. from .unix import Unix, UnixError
  19. from calculate.ldap.ldap import LdapError
  20. from calculate.server.variables.action import Actions as ServerActions
  21. from utils.cl_unix_setup import ClUnixSetupAction
  22. _ = lambda x: x
  23. from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate
  24. setLocalTranslate('cl_unix3', sys.modules[__name__])
  25. __ = getLazyLocalTranslate(_)
  26. class Wsdl(WsdlBase):
  27. methods = [
  28. #
  29. # Настроить службу
  30. #
  31. {
  32. # идентификатор метода
  33. 'method_name': Unix.Method.Setup,
  34. # категория метода
  35. 'category': __('Unix'),
  36. # заголовок метода
  37. 'title': __("Setup"),
  38. # иконка для графической консоли
  39. 'image': 'setup',
  40. # метод присутствует в графической консоли
  41. 'gui': True,
  42. # консольная команда
  43. 'command': 'cl-unix-setup',
  44. # права для запуска метода
  45. 'rights': ['unix'],
  46. # объект содержащий модули для действия
  47. 'logic': {'Unix': Unix},
  48. # описание действия
  49. 'action': ClUnixSetupAction,
  50. # объект переменных
  51. 'datavars': "unix",
  52. 'native_error': (VariableError, DataVarsError, LdapError, UnixError),
  53. # значения по умолчанию для переменных этого метода
  54. 'setvars': {'cl_action!': ServerActions.Setup,
  55. 'server.cl_server_name!': "unix",
  56. 'cl_autoupdate_set': 'on'
  57. # 'cl_dispatch_conf_default': "usenew"
  58. },
  59. # описание груп (список лямбда функций)
  60. 'groups': [
  61. lambda group: group(
  62. _("Unix server"),
  63. brief=('ldap.ld_base_dn',),
  64. hide=(),
  65. normal=(),
  66. expert=()),
  67. ],
  68. 'brief': {'next': __("Perform"),
  69. 'name': __("Setup Unix"),}
  70. },
  71. ]