Exemple #1
0
    def stop(self, **kwargs):
        """
            Stops a max instance.

            Supervisord process must be running in order to use this command
        """
        instance_name = getOptionFrom(kwargs, 'instance-name')
        maxserver = self.Server
        status = maxserver.get_status(instance_name)

        if status['status'] == 'running':
            maxserver.stop(instance_name)
        else:
            padded_success("Already stopped")
Exemple #2
0
    def start(self, **kwargs):
        """
            Starts a max instance.

            If the instance is not loaded on supervisor, it will be loaded and started.
            In every other case the instance will be started from the prior status.
            Supervisord process must be running in order to use this command
        """
        instance_name = getOptionFrom(kwargs, 'instance-name')
        maxserver = self.Server
        status = maxserver.get_status(instance_name)
        if status['status'] == 'running':
            padded_success("Already running")
        else:
            maxserver.start(instance_name)
Exemple #3
0
    def stop(self, **kwargs):
        """
            Stops an oauth instance.

            Supervisord process must be running in order to use this command
        """
        instance_name = getOptionFrom(kwargs, 'instance-name')
        oauth = self.Server
        status = oauth.get_status(instance_name)
        if status['status'] == 'running':
            oauth.stop(instance_name)
        else:
            padded_success("Already stopped")
        if status['status'] == 'stopped':
            print '\nAlready stopped\n'