示例#1
0
文件: tools.py 项目: maximerobin/Ufwi
 def checkServiceCall(self, context, service_name):
     if 'rebootSystem' == service_name \
     and context.isComponentContext() \
     and 'config' == context.component.name:
         # config component doesn't need a lock to reboot the system
         return
     AbstractNuConfComponent.checkServiceCall(self, context, service_name)
示例#2
0
    def checkServiceCall(self, context, service_name):
        """Allow each component to call their reload, restart, start and stop services"""
        if (context.isComponentContext() and context.ownerString() == self.NAME
          and service_name in ['reload', 'restart', 'start', 'status', 'stop']):
            return

        AbstractNuConfComponent.checkServiceCall(self, context, service_name)
示例#3
0
 def checkServiceCall(self, context, service_name):
     if 'sendMailToAdmin' == service_name:
         # lock is not needed when sending an email
         return
     return AbstractNuConfComponent.checkServiceCall(self, context, service_name)