Example #1
0
    def do_setup(self, line):
        """Setup system, deploy configs and urls"""
        if not self._cannon_infos:
            print 'ERROR: No cannons defined, try "config" or "deploy"'
            return

        start_time = time.time()
        print 'Setting up cannons'
        self._cannon_hosts = [h[1] for h in self._cannon_infos]
        status = setup_cannons(self._cannon_hosts)

        if self._siege_config:
            if self._write_siege_config(self._siege_config):
                print 'Siege config written, deploying to cannons'
                setup_siege(self._cannon_hosts)
            else:
                print 'ERROR: Cannot write new siege config'

        if self._siege_urls:
            if self._write_siege_urls(self._siege_urls):
                print 'Siege urls written, deploying to cannons'
                setup_siege_urls(self._cannon_hosts)
            else:
                print 'ERROR: Cannot write urls'

        print 'Finished setup - time: %s' % (time.time()-start_time)

        print 'Sending reboot message to cannons'
        reboot_cannons([h[0] for h in self._cannon_infos])
        self._cannons_deployed = True
Example #2
0
    def do_setup(self, line):
        """Setup system, deploy configs and urls"""
        if not self._cannon_infos:
            print 'ERROR: No cannons defined, try "config" or "deploy"'
            return

        start_time = time.time()
        print 'Setting up cannons'
        self._cannon_hosts = [h[1] for h in self._cannon_infos]
        status = setup_cannons(self._cannon_hosts)

        if self._siege_config:
            if self._write_siege_config(self._siege_config):
                print 'Siege config written, deploying to cannons'
                setup_siege(self._cannon_hosts)
            else:
                print 'ERROR: Cannot write new siege config'

        if self._siege_urls:
            if self._write_siege_urls(self._siege_urls):
                print 'Siege urls written, deploying to cannons'
                setup_siege_urls(self._cannon_hosts)
            else:
                print 'ERROR: Cannot write urls'

        print 'Finished setup - time: %s' % (time.time()-start_time)

        print 'Sending reboot message to cannons'
        reboot_cannons([h[0] for h in self._cannon_infos])
        self._cannons_deployed = True
Example #3
0
    def do_setup(self, line):
        """Setup system, deploy configs and urls"""
        if not self._cannon_infos:
            print 'ERROR: No cannons defined, try "config" or "deploy"'
            return

        start_time = time.time()
        print 'Setting up cannons'
        self._cannon_hosts = [h[1] for h in self._cannon_infos]
        status = setup_cannons(self._cannon_hosts)


        print status

        print 'Finished setup - time: %s' % (time.time() - start_time)

        print 'Sending reboot message to cannons'
        reboot_cannons([h[0] for h in self._cannon_infos])
        self._cannons_deployed = True