コード例 #1
0
ファイル: Zorpctl.py プロジェクト: kmarcell/zorp
    def reload(listofinstances):
        """
        Reloads Zorp instance(s) by instance name
        expects sequence of name(s)
        """
        UInterface.informUser("Reloading Zorp Firewall Suite:")

        if not listofinstances:
            UInterface.informUser(ZorpHandler.reload())
        else:
            algorithm = ReloadAlgorithm()
            Zorpctl.runAlgorithmOnList(listofinstances, algorithm)
コード例 #2
0
ファイル: Zorpctl.py プロジェクト: kmarcell/zorp
    def reload_or_restart(listofinstances):
        """
        Tries to reload Zorp instance(s) by instance name
        if not succeeded than tries to restart instance(s)
        expects sequence of name(s)
        """

        UInterface.informUser("Reloading or Restarting Zorp Firewall Suite:")
        if not listofinstances:
            reload_result = ZorpHandler.reload()
            Zorpctl._restartWhichNotReloaded(reload_result)
        else:
            for instance_name in listofinstances:
                reload_result = Zorpctl.runAlgorithmOnProcessOrInstance(instance_name, ReloadAlgorithm())
                if utils.isSequence(reload_result):
                    Zorpctl._restartWhichNotReloaded(reload_result)
                else:
                    if reload_result:
                        UInterface.informUser(reload_result)
                    else:
                        Zorpctl.restart([instance_name])