Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

66 řádky
2.3 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.core.server.func import Action, Tasks
  17. from calculate.lib.cl_lang import setLocalTranslate, getLazyLocalTranslate
  18. from calculate.lib.cl_template import TemplatesError
  19. from calculate.lib.utils.files import FilesError
  20. from calculate.lib.datavars import VariableError
  21. from calculate.server.variables.action import Actions
  22. from ..unix import UnixError, Unix
  23. from calculate.ldap.ldap import LdapError
  24. from calculate.ldap.utils.cl_ldap_setup import MetaTasks
  25. from calculate.ldap.utils.cl_ldap_setup import ClLdapSetupAction
  26. from calculate.server.server import ServerError
  27. _ = lambda x: x
  28. setLocalTranslate('cl_unix3', sys.modules[__name__])
  29. __ = getLazyLocalTranslate(_)
  30. class ClUnixGroupaddAction(Action):
  31. """
  32. Действие обновление конфигурационных файлов
  33. """
  34. # ошибки, которые отображаются без подробностей
  35. native_error = (FilesError,
  36. TemplatesError,
  37. VariableError,
  38. ServerError,
  39. UnixError,
  40. LdapError)
  41. successMessage = __("Group {ur_unix_group_name} added to Unix service!")
  42. failedMessage = __("Failed to add {ur_unix_group_name} group "
  43. "in Unix server!")
  44. interruptMessage = __("Adding of new group manually interrupted")
  45. stop_tasks = [
  46. ]
  47. meta_tasks = MetaTasks("Unix")
  48. # список задач для действия
  49. tasks = [
  50. {'name': 'apply_ldif',
  51. 'tasks': meta_tasks.ldif_task("unix.ld_unix_bind_dn,unix.ld_unix_pw",
  52. Actions.Setup)
  53. },
  54. ]