From cb528baf964a3a4993f97958bd9de3dd07957709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20de=20Saint=20Martin?= <cedric.dsm@tiolive.com> Date: Wed, 25 Jul 2012 18:50:42 +0200 Subject: [PATCH] Remove trailing whitespaces on all slapos.git except ERP5 related. --- slapos/recipe/fontconfig/__init__.py | 2 +- slapos/recipe/haproxy/__init__.py | 6 ++--- slapos/recipe/kumofs/__init__.py | 10 +++---- slapos/recipe/lamp/__init__.py | 6 ++--- slapos/recipe/lamp/runner.py | 4 +-- slapos/recipe/logrotate.py | 2 +- slapos/recipe/memcached/__init__.py | 8 +++--- slapos/recipe/nosqltestbed/kumo/__init__.py | 8 +++--- slapos/recipe/proactive/__init__.py | 6 ++--- slapos/recipe/pulse2/__init__.py | 26 +++++++++---------- .../ERP5TypeFunctionalTestCase.py | 2 +- slapos/recipe/seleniumrunner/__init__.py | 2 +- slapos/recipe/seleniumrunner/testrunner.py | 8 +++--- slapos/recipe/sheepdogtestbed/__init__.py | 12 ++++----- slapos/recipe/siptester/__init__.py | 4 +-- slapos/recipe/slaprunner/__init__.py | 2 +- slapos/recipe/softwaretype.py | 2 +- slapos/recipe/sphinx/__init__.py | 6 ++--- software/net2ftp/configure.py | 6 ++--- software/zencart/configure.py | 4 +-- 20 files changed, 63 insertions(+), 63 deletions(-) diff --git a/slapos/recipe/fontconfig/__init__.py b/slapos/recipe/fontconfig/__init__.py index c60e42b5aa..d52496aec7 100644 --- a/slapos/recipe/fontconfig/__init__.py +++ b/slapos/recipe/fontconfig/__init__.py @@ -77,7 +77,7 @@ class Recipe(GenericBaseRecipe): onetimedownload_config['url'] = url onetimedownload_config['file_path'] = file_path onetimedownload_runner_path = self.createExecutable(bin_path, - self.substituteTemplate(wrapper_template_location, + self.substituteTemplate(wrapper_template_location, onetimedownload_config)) created_file_list.append(onetimedownload_runner_path) diff --git a/slapos/recipe/haproxy/__init__.py b/slapos/recipe/haproxy/__init__.py index ac7a064331..2fcc5e3365 100644 --- a/slapos/recipe/haproxy/__init__.py +++ b/slapos/recipe/haproxy/__init__.py @@ -77,13 +77,13 @@ class Recipe(GenericBaseRecipe): i += 1 server_snippet += self.substituteTemplate( snippet_filename, dict( - name='%s_%s' % (name, i), + name='%s_%s' % (name, i), address=address, cluster_zope_thread_amount=self.options['maxconn'])) config = dict( - name=name, - ip=self.options['ip'], + name=name, + ip=self.options['ip'], port=self.options['port'], server_text=server_snippet, server_check_path=self.options['server-check-path'],) diff --git a/slapos/recipe/kumofs/__init__.py b/slapos/recipe/kumofs/__init__.py index f2e9289708..59de986a00 100644 --- a/slapos/recipe/kumofs/__init__.py +++ b/slapos/recipe/kumofs/__init__.py @@ -43,15 +43,15 @@ class Recipe(BaseSlapRecipe): # XXX-Cedric : add logrotate? self.cron_d = self.installCrond() kumo_conf = self.installKumo(self.getLocalIPv4Address()) - + ca_conf = self.installCertificateAuthority() key, certificate = self.requestCertificate('Login Based Access') - + stunnel_conf = self.installStunnel(self.getGlobalIPv6Address(), self.getLocalIPv4Address(), 12345, kumo_conf['kumo_gateway_port'], certificate, key, ca_conf['ca_crl'], ca_conf['certificate_authority_path']) - + self.linkBinary() self.setConnectionDict(dict( stunnel_ip = stunnel_conf['public_ip'], @@ -80,7 +80,7 @@ class Recipe(BaseSlapRecipe): os.symlink(target, link) self.logger.debug('Created link %r -> %r' % (link, target)) self.path_list.append(link) - + def installCrond(self): timestamps = self.createDataDirectory('cronstamps') @@ -103,7 +103,7 @@ class Recipe(BaseSlapRecipe): )[0] self.path_list.append(wrapper) return cron_d - + def installLogrotate(self): """Installs logortate main configuration file and registers its to cron""" logrotate_d = os.path.abspath(os.path.join(self.etc_directory, diff --git a/slapos/recipe/lamp/__init__.py b/slapos/recipe/lamp/__init__.py index 710cc07603..0dee5db1ba 100644 --- a/slapos/recipe/lamp/__init__.py +++ b/slapos/recipe/lamp/__init__.py @@ -158,7 +158,7 @@ class BaseRecipe(BaseSlapRecipe): open(destination, 'w').write(open(template, 'r').read() % d) def configureInstallation(self, document_root, url, mysql_conf): - """Start process which can launch python scripts, move or remove files or + """Start process which can launch python scripts, move or remove files or directories when installing software. """ if not self.options.has_key('delete') and not self.options.has_key('rename') and not\ @@ -179,7 +179,7 @@ class BaseRecipe(BaseSlapRecipe): else: argument = argument + ["-f", self.options['file_token'].strip()] argument += ["-t", document_root] - + if self.options.has_key('delete'): delete = ["delete"] for fname in self.options['delete'].split(','): @@ -231,7 +231,7 @@ class Simple(BaseRecipe): url = self.installApache(document_root) renamed = self.configureInstallation(document_root, url, mysql_conf) connectionDict = dict( - url=url, + url=url, **mysql_conf ) if not renamed == "": diff --git a/slapos/recipe/lamp/runner.py b/slapos/recipe/lamp/runner.py index 8ec60ce88a..b4ef29890f 100644 --- a/slapos/recipe/lamp/runner.py +++ b/slapos/recipe/lamp/runner.py @@ -1,8 +1,8 @@ import sys import subprocess - + def executeRunner(args): - """Start the instance configure. this may run a python script, move or/and rename + """Start the instance configure. this may run a python script, move or/and rename file or directory when dondition is filled. the condition may be when file exist or when an entry exist into database. """ diff --git a/slapos/recipe/logrotate.py b/slapos/recipe/logrotate.py index 06a455379e..1c8b7856a3 100644 --- a/slapos/recipe/logrotate.py +++ b/slapos/recipe/logrotate.py @@ -41,7 +41,7 @@ class Recipe(GenericBaseRecipe): 'include %s' % logrotate_d, ] - logrotate_conf_file = self.createFile(logrotate_conf_file, + logrotate_conf_file = self.createFile(logrotate_conf_file, '\n'.join(logrotate_conf)) state_file = self.options['state-file'] diff --git a/slapos/recipe/memcached/__init__.py b/slapos/recipe/memcached/__init__.py index 431ebe1565..a8f75ab48c 100644 --- a/slapos/recipe/memcached/__init__.py +++ b/slapos/recipe/memcached/__init__.py @@ -44,7 +44,7 @@ class Recipe(BaseSlapRecipe): self.cron_d = self.installCrond() memcached_conf = self.installMemcached(ip=self.getLocalIPv4Address(), port=11000) - + ca_conf = self.installCertificateAuthority() key, certificate = self.requestCertificate('Memcached') @@ -52,7 +52,7 @@ class Recipe(BaseSlapRecipe): self.getLocalIPv4Address(), 12345, memcached_conf['memcached_port'], certificate, key, ca_conf['ca_crl'], ca_conf['certificate_authority_path']) - + self.linkBinary() self.setConnectionDict(dict( stunnel_ip = stunnel_conf['public_ip'], @@ -81,7 +81,7 @@ class Recipe(BaseSlapRecipe): os.symlink(target, link) self.logger.debug('Created link %r -> %r' % (link, target)) self.path_list.append(link) - + def installCrond(self): timestamps = self.createDataDirectory('cronstamps') cron_output = os.path.join(self.log_directory, 'cron-output') @@ -103,7 +103,7 @@ class Recipe(BaseSlapRecipe): )[0] self.path_list.append(wrapper) return cron_d - + def installLogrotate(self): """Installs logortate main configuration file and registers its to cron""" logrotate_d = os.path.abspath(os.path.join(self.etc_directory, diff --git a/slapos/recipe/nosqltestbed/kumo/__init__.py b/slapos/recipe/nosqltestbed/kumo/__init__.py index 1d3f2cc4ad..cbc11bf18b 100644 --- a/slapos/recipe/nosqltestbed/kumo/__init__.py +++ b/slapos/recipe/nosqltestbed/kumo/__init__.py @@ -43,14 +43,14 @@ class KumoTestBed(object): kumo_cloud_config['address'] = recipe.getGlobalIPv6Address() kumo_cloud_config['report_path'] = recipe.log_directory - + kumo_cloud_config.setdefault('max_server', 4) kumo_cloud_config.setdefault('max_tester', 5) kumo_cloud_config.setdefault('nb_thread', 32) kumo_cloud_config.setdefault('nb_request', 1024000) kumo_cloud_config.setdefault('erp5_publish_url', '') kumo_cloud_config.setdefault('erp5_publish_project', '') - + computer_guid_list = [] computer_guid_list.append("COMP-23") # manager computer_guid_list.append("COMP-13") # server 1 @@ -62,9 +62,9 @@ class KumoTestBed(object): computer_guid_list.append("COMP-14") # tester 3 computer_guid_list.append("COMP-20") # tester 4 computer_guid_list.append("COMP-19") # tester 5 - + kumo_cloud_config.setdefault('computer_guid_list', ":".join(computer_guid_list)) - + kumo_cloud_config['software_release_url'] = recipe.software_release_url kumo_cloud_config['server_url'] = recipe.server_url kumo_cloud_config['key_file'] = recipe.key_file diff --git a/slapos/recipe/proactive/__init__.py b/slapos/recipe/proactive/__init__.py index 7b5f35557a..e3fe2c47ff 100644 --- a/slapos/recipe/proactive/__init__.py +++ b/slapos/recipe/proactive/__init__.py @@ -36,7 +36,7 @@ class Recipe(BaseSlapRecipe): #ipv6 = self.getGlobalIPv6Address(parameter_dict) proactive_home = self.options['proactive_location'] - + # ProActive parameters proactive_rmUrl = parameter_dict.get('rmURL') proactive_credential = parameter_dict.get('credentials') @@ -55,7 +55,7 @@ class Recipe(BaseSlapRecipe): ) self._writeFile(proactive_configuration_file, pkg_resources.resource_string( __name__, 'template/ProActiveConfiguration.xml.in') % proactive_dict) - + # ProActive wrapper #proactive = os.path.join(proactive_home, 'bin', 'unix', 'rm-start-node') proactive_pa_bundle = os.path.join(proactive_home, 'PABundle') @@ -74,4 +74,4 @@ sh %(proactive)s %(rmUrl)s %(nsname)s %(credential)s self.computer_partition.setConnectionDict(dict( #proactive_ip="[%s]" % (ipv6), )) - return [proactive_configuration_file, proactive_wrapper] \ No newline at end of file + return [proactive_configuration_file, proactive_wrapper] diff --git a/slapos/recipe/pulse2/__init__.py b/slapos/recipe/pulse2/__init__.py index a1deec9cef..498bb671e2 100644 --- a/slapos/recipe/pulse2/__init__.py +++ b/slapos/recipe/pulse2/__init__.py @@ -43,17 +43,17 @@ class Recipe(BaseSlapRecipe): document_root = self.createDataDirectory('htdocs') self.createHtdocs(self.options['source'].strip(), document_root) url = self.installApache(document_root) - + # MySQL mysql_conf = self.installMysqlServer(self.getLocalIPv4Address(), 45678) - + # LDAP ldap_port = dict() - + # Pulse mmc_core_conf = self.installPulse2(ip=self.getLocalIPv4Address(), port=11000, ldap_host=ldap_conf['host'], ldap_port=ldap_conf['port']) - + ca_conf = self.installCertificateAuthority() key, certificate = self.requestCertificate('Pulse') @@ -61,7 +61,7 @@ class Recipe(BaseSlapRecipe): self.getLocalIPv4Address(), 12345, pulse_conf['inventory_port'], certificate, key, ca_conf['ca_crl'], ca_conf['certificate_authority_path']) - + self.linkBinary() self.setConnectionDict(dict( stunnel_inventory_ip = stunnel_conf['public_ip'], @@ -92,7 +92,7 @@ class Recipe(BaseSlapRecipe): os.symlink(target, link) self.logger.debug('Created link %r -> %r' % (link, target)) self.path_list.append(link) - + def installCrond(self): timestamps = self.createDataDirectory('cronstamps') cron_output = os.path.join(self.log_directory, 'cron-output') @@ -114,7 +114,7 @@ class Recipe(BaseSlapRecipe): )[0] self.path_list.append(wrapper) return cron_d - + def installLogrotate(self): """Installs logortate main configuration file and registers its to cron""" logrotate_d = os.path.abspath(os.path.join(self.etc_directory, @@ -247,26 +247,26 @@ class Recipe(BaseSlapRecipe): ldap_logfile_path= os.path.join(self.log_directory, 'ldap.log'), mmc_core_binary=self.options['mmc_core_binary'] ) - - #TODO write function that takes all templates in subdir and creates conf + + #TODO write function that takes all templates in subdir and creates conf # files, keeping same dir structure. mmc_conf_path = self.createConfigurationFile(os.path.join("mmc", "agent", "config.ini"), self.substituteTemplate( self.getTemplateFilename(os.path.join("mmc_conf", "agent", "config.ini.in")), config)) config['mmc_core_config_file'] = mysql_conf_path - + self.path_list.append(self.createRunningWrapper('mmc-core', self.substituteTemplate(self.getTemplateFilename('mmc-core.in'), config))) - + return dict(memcached_url='%s:%s' % (config['memcached_ip'], config['memcached_port']), memcached_ip=config['memcached_ip'], memcached_port=config['memcached_port']) - + def createHtdocs(self, source, document_root): source = self.options['source'].strip() document_root = self.createDataDirectory('htdocs') @@ -282,7 +282,7 @@ class Recipe(BaseSlapRecipe): shutil.copytree(path, os.path.join(document_root, p)) else: shutil.copy2(path, os.path.join(document_root, p)) - + def installApache(self, document_root, ip=None, port=None): if ip is None: ip=self.getGlobalIPv6Address() diff --git a/slapos/recipe/seleniumrunner/ERP5TypeFunctionalTestCase.py b/slapos/recipe/seleniumrunner/ERP5TypeFunctionalTestCase.py index c4e57b9bee..45ff71b2cb 100644 --- a/slapos/recipe/seleniumrunner/ERP5TypeFunctionalTestCase.py +++ b/slapos/recipe/seleniumrunner/ERP5TypeFunctionalTestCase.py @@ -27,7 +27,7 @@ # ############################################################################## -# XXX-Cedric : This is an import of +# XXX-Cedric : This is an import of # http://git.erp5.org/gitweb/erp5.git/blob/HEAD:/product/ERP5Type/tests/ERP5TypeFunctionalTestCase.py # Modification of the present file should be ported back to this original file. import os diff --git a/slapos/recipe/seleniumrunner/__init__.py b/slapos/recipe/seleniumrunner/__init__.py index b620775029..b7d5c09416 100644 --- a/slapos/recipe/seleniumrunner/__init__.py +++ b/slapos/recipe/seleniumrunner/__init__.py @@ -37,7 +37,7 @@ class Recipe(GenericBaseRecipe): runner = self.createPythonScript( self.options['runner-path'], __name__+'.testrunner.run', - arguments=[self.options['suite-url'], + arguments=[self.options['suite-url'], self.options['report-url'], self.options['report-project'], self.options['browser'], diff --git a/slapos/recipe/seleniumrunner/testrunner.py b/slapos/recipe/seleniumrunner/testrunner.py index 91d0bc28cc..d3a3aae58a 100644 --- a/slapos/recipe/seleniumrunner/testrunner.py +++ b/slapos/recipe/seleniumrunner/testrunner.py @@ -57,7 +57,7 @@ def run(args): # There is no test that can take more them 24 hours timeout = 2.0 * 60 * 60 - + while True: erp5_report = ERP5TestReportHandler(report_url, project + '@' + config['suite_name']) @@ -82,11 +82,11 @@ def run(args): if process.pid: os.kill(process.pid, signal.SIGTERM) print("Test has finished and Firefox has been killed.") - + erp5_report.reportFinished(getStatus(config['base_url']).encode("utf-8", "replace")) - - + + print("Test finished and report sent, sleeping.") except urllib2.URLError, urlError: print "Error: %s" % urlError.msg diff --git a/slapos/recipe/sheepdogtestbed/__init__.py b/slapos/recipe/sheepdogtestbed/__init__.py index c15e1bcea2..ef0b7da163 100644 --- a/slapos/recipe/sheepdogtestbed/__init__.py +++ b/slapos/recipe/sheepdogtestbed/__init__.py @@ -49,23 +49,23 @@ class SheepDogTestBed(BaseSlapRecipe): def run_sheepdog_test(self): """ Launch sheepdog test process. """ - + sheepdog_test_config = {} sheepdog_test_config.update(self.options) sheepdog_test_config.update(self.parameter_dict) sheepdog_test_config['address'] = self.getGlobalIPv6Address() sheepdog_test_config['report_path'] = self.log_directory - + if 'nb_server_max' not in sheepdog_test_config: sheepdog_test_config['nb_server_max'] = 0 - + if 'nb_tester_max' not in sheepdog_test_config: sheepdog_test_config['nb_tester_max'] = 3 - + if 'nb_thread' not in sheepdog_test_config: sheepdog_test_config['nb_thread'] = 1 - + if 'nb_request' not in sheepdog_test_config: sheepdog_test_config['nb_request'] = 1000 @@ -81,7 +81,7 @@ class SheepDogTestBed(BaseSlapRecipe): sheepdog_test_connection = {} sheepdog_test_connection['url'] = "http://["+sheepdog_test_config['address']+"]:5000/" self.computer_partition.setConnectionDict(sheepdog_test_connection) - + nosqltester_manager_wrapper_template_location = pkg_resources.resource_filename( __name__, os.path.join( 'template', 'nosqltester_manager_run.in')) diff --git a/slapos/recipe/siptester/__init__.py b/slapos/recipe/siptester/__init__.py index 7cbde1fbbf..17aaa0df30 100644 --- a/slapos/recipe/siptester/__init__.py +++ b/slapos/recipe/siptester/__init__.py @@ -11,7 +11,7 @@ class SipTesterRecipe(BaseSlapRecipe): def _createPJSUAConfiguration(self, template_name): pjsua_input = pkg_resources.resource_string(__name__, os.path.join( 'template', template_name)) - if self._writeFile(self.pjsua_configuration_file, + if self._writeFile(self.pjsua_configuration_file, pjsua_input % self.options): # XXX: How to inform slap/slapgrid that something changed and it might # be not bad idea to restart CP? @@ -30,7 +30,7 @@ class SipTesterRecipe(BaseSlapRecipe): d['siptester_binary'] = os.path.join(self.buildout['software_definition' ]['software_home'].strip(), 'bin', 'siptester') self.running_wrapper_location = pkg_resources.resource_filename(__name__, os.path.join( - 'template', + 'template', self.wrapper_template)) self._createRunningWrapper(d) return [path, wrapper_path] diff --git a/slapos/recipe/slaprunner/__init__.py b/slapos/recipe/slaprunner/__init__.py index 4cdb935c8a..ad4072626e 100644 --- a/slapos/recipe/slaprunner/__init__.py +++ b/slapos/recipe/slaprunner/__init__.py @@ -71,7 +71,7 @@ class Recipe(GenericBaseRecipe): private_key=self.options['private_key'], cloud9_url=self.cloud9_url ) - + config_file = self.createFile(self.options['slapos.cfg'], self.substituteTemplate(self.getTemplateFilename('slapos.cfg.in'), configuration)) diff --git a/slapos/recipe/softwaretype.py b/slapos/recipe/softwaretype.py index 825a153f1a..b16625b5bd 100644 --- a/slapos/recipe/softwaretype.py +++ b/slapos/recipe/softwaretype.py @@ -120,7 +120,7 @@ class Recipe: self.getLocalIPv4Address()) buildout.set('slap-network-information', 'global-ipv6', self.getGlobalIPv6Address()) - buildout.set('slap-network-information', 'network-interface', + buildout.set('slap-network-information', 'network-interface', self.getNetworkInterface()) # Copy/paste slap_connection diff --git a/slapos/recipe/sphinx/__init__.py b/slapos/recipe/sphinx/__init__.py index 2dd2eee1ff..a22e07b452 100644 --- a/slapos/recipe/sphinx/__init__.py +++ b/slapos/recipe/sphinx/__init__.py @@ -42,15 +42,15 @@ class Recipe(GenericBaseRecipe): pid=self.options['pid'], ) sphinx_conf_path = self.createFile( - self.options['configuration-file'], + self.options['configuration-file'], self.substituteTemplate(self.getTemplateFilename('sphinx.conf.in'), config) ) # Create init script wrapper = self.createPythonScript( - self.options['wrapper'], - 'slapos.recipe.librecipe.execute.execute', + self.options['wrapper'], + 'slapos.recipe.librecipe.execute.execute', [self.options['sphinx-searchd-binary'].strip(), '-c', sphinx_conf_path, '--nodetach'], ) diff --git a/software/net2ftp/configure.py b/software/net2ftp/configure.py index 2c16f4e3c7..30ae4e1998 100644 --- a/software/net2ftp/configure.py +++ b/software/net2ftp/configure.py @@ -4,7 +4,7 @@ import MySQLdb def setup(args): mysql_port, mysql_host, mysql_user, mysql_password, mysql_database, base_url, htdocs = args - + sql_file = os.path.join(htdocs, "create_tables.sql") try: conn = MySQLdb.connect (host = mysql_host, @@ -19,7 +19,7 @@ def setup(args): sql_script = f.readline() conn.close() except: - return + return if __name__ == '__main__': - setup(sys.argv[1:]) \ No newline at end of file + setup(sys.argv[1:]) diff --git a/software/zencart/configure.py b/software/zencart/configure.py index 1f6eb6a92d..a8c9e6fad5 100644 --- a/software/zencart/configure.py +++ b/software/zencart/configure.py @@ -4,7 +4,7 @@ import fileinput def setup(args): mysql_port, mysql_host, mysql_user, mysql_password, mysql_database, base_url, htdocs = args - + admin_dir = "admin-" + mysql_user admin_include_file = os.path.join(htdocs, admin_dir + "/includes/configure.php") searchPattern = "/admin" @@ -17,4 +17,4 @@ def setup(args): os.chmod(admin_include_file, 0444) if __name__ == '__main__': - setup(sys.argv[1:]) \ No newline at end of file + setup(sys.argv[1:]) -- 2.30.9