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_siege_urls(self, line):
        """Create siege urls file, deploy it to cannons"""
        if self._cannons_deployed:
            if self._siege_urls:
                print '  Urls detected in settings and will be automatically deployed with "setup"'
                answer = raw_input('  Continue? (y/n) ')
                if answer == 'n':
                   return

            siege_urls = raw_input('  Enter urls: ')
            if self._write_siege_urls(eval(siege_urls)):
                print 'Urls written, deploying to cannons'
                setup_siege_urls(self._cannon_hosts)
                self._siege_urls = eval(siege_urls)
            else:
                print 'ERROR: Cannot write new urls'
        else:
            print 'ERROR: Cannons not deployed yet'
Example #4
0
    def do_siege_urls(self, line):
        """Create siege urls file, deploy it to cannons"""
        if self._cannons_deployed:
            if self._siege_urls:
                print '  Urls detected in settings and will be automatically deployed with "setup"'
                answer = raw_input('  Continue? (y/n) ')
                if answer == 'n':
                   return

            siege_urls = raw_input('  Enter urls: ')
            if self._write_siege_urls(eval(siege_urls)):
                print 'Urls written, deploying to cannons'
                setup_siege_urls(self._cannon_hosts)
                self._siege_urls = eval(siege_urls)
            else:
                print 'ERROR: Cannot write new urls'
        else:
            print 'ERROR: Cannons not deployed yet'