#!/usr/bin/env python
# coding:utf-8

from .plugin import PluginAbstract, ModList
from cplLdaptool import LdapMod
from .samba4ad import Samba4AD
from .afp_uuid import AfpUUID

msg0101 = 'nothing to do for: \'{0}\''


class GosaGroup(PluginAbstract, Samba4AD, AfpUUID, metaclass=ModList):

	def __init__(self, postcmd):

		#super(GosaGroup, self).__init__(postcmd)
		super().__init__(postcmd)
		super(PluginAbstract, self).__init__(postcmd)
		super(Samba4AD, self).__init__(postcmd)
		self.ldapmod = LdapMod(self.gosa_ldap, self.logger)


	def create(self):

		super().create()

		self.addUUID()
		self.createADgroup()


	def modify(self):

		super().modify()

		self.addUUID()
		self.createADgroup(True)


	def preremove(self):

		super().preremove()

		self.delUUID()
		self.removeADgroup()


