diff --git a/slapos/recipe/pbs.py b/slapos/recipe/pbs.py index 3cdf9b498bc69c408428956eea70f3c9522aa3f7..d886b945d83e367ffa0b97daf78e5678fd16a227 100644 --- a/slapos/recipe/pbs.py +++ b/slapos/recipe/pbs.py @@ -25,8 +25,7 @@ # ############################################################################## -from hashlib import sha512 -import inspect +import hashlib import json import os import signal @@ -43,33 +42,14 @@ from slapos import slap as slapmodule def promise(args): - def failed_ssh(partition, ssh): + def failed_ssh(): sys.stderr.write("SSH Connection failed\n") - try: - ssh.terminate() - except: - pass + partition = slap.registerComputerPartition(args['computer_id'], + args['partition_id']) partition.bang("SSH Connection failed. rdiff-backup is unusable.") def sigterm_handler(signum, frame): - # Walk up in the stack to get promise local - # variables - ssh = None - for upper_frame in inspect.getouterframes(frame): - # Use promise.func_name insteand of 'promise' in order to be - # detected by editor if promise func name change. - # Else, it's hard to debug this kind of error. - if upper_frame[3] == promise.func_name: - try: - partition = upper_frame[0].f_locals['partition'] - ssh = upper_frame[0].f_locals['ssh'] - except KeyError: - raise SystemExit("SIGTERM Send too soon.") - break - # If ever promise function wasn't found in the stack. - if ssh is None: - raise SystemExit - failed_ssh(partition, ssh) + failed_ssh() signal.signal(signal.SIGTERM, sigterm_handler) @@ -78,9 +58,6 @@ def promise(args): key_file=args.get('key_file'), cert_file=args.get('cert_file')) - partition = slap.registerComputerPartition(args['computer_id'], - args['partition_id']) - ssh = subprocess.Popen([args['ssh_client'], '%(user)s@%(host)s/%(port)s' % args], stdin=subprocess.PIPE, stdout=open(os.devnull, 'w'), @@ -97,7 +74,7 @@ def promise(args): if ssh.poll() is None: return 1 if ssh.returncode != 0: - failed_ssh(partition, ssh) + failed_ssh() return ssh.returncode @@ -108,12 +85,12 @@ class Recipe(GenericSlapRecipe, Notify, Callback): path_list = [] url = entry.get('url') - if url is None: - url = '' + if not url: + raise ValueError('Missing URL parameter for PBS recipe') # We assume that thanks to sha512 there's no collisions - url_hash = sha512(url).hexdigest() - name_hash = sha512(entry['name']).hexdigest() + url_hash = hashlib.sha512(url).hexdigest() + name_hash = hashlib.sha512(entry['name']).hexdigest() promise_path = os.path.join(self.options['promises-directory'], url_hash) diff --git a/slapos/recipe/request.py b/slapos/recipe/request.py index a51724b46aab9469fc5f20e5b46102bc344b9352..952963606a22749d5aece0e7d0c62da65fd180e7 100644 --- a/slapos/recipe/request.py +++ b/slapos/recipe/request.py @@ -203,7 +203,7 @@ class RequestOptional(Recipe): status = self.instance.getState() else: status = 'not ready yet' - except (slapmodule.NotFoundError, slapmodule.ServerError): + except (slapmodule.NotFoundError, slapmodule.ServerError, slapmodule.ResourceNotReady): status = 'not ready yet' except AttributeError: status = 'unknown' diff --git a/slapos/recipe/symbolic_link.py b/slapos/recipe/symbolic_link.py index 124d03b9e63426ce6348a92e8a32bbd27704dd0f..72ec167d0f2a41482ad15af8c6aca1d0a218a6ce 100644 --- a/slapos/recipe/symbolic_link.py +++ b/slapos/recipe/symbolic_link.py @@ -51,7 +51,7 @@ class Recipe: if os.path.lexists(link): if not os.path.islink(link): raise zc.buildout.UserError( - 'Target link already %r exists but it is not link' % link) + 'Target %r already exists but is not a link' % link) os.unlink(link) os.symlink(linkline, link) self.logger.debug('Created link %r -> %r' % (link, linkline)) diff --git a/software/maarch/development.cfg b/software/maarch/development.cfg index 565567f93a08f65013ce98f85f12c8202aedcf50..aae27ed67c2818d749ac723a68ae66b79bbf9995 100644 --- a/software/maarch/development.cfg +++ b/software/maarch/development.cfg @@ -35,7 +35,7 @@ git-executable = ${git:location}/bin/git [slapos.cookbook-repository] recipe = slapos.recipe.build:gitclone repository = http://git.erp5.org/repos/slapos.git -branch = lapp-resilient3 +branch = master git-executable = ${git:location}/bin/git [slapos.core-repository] diff --git a/software/maarch/software.cfg b/software/maarch/software.cfg index 69862a98c23186f3280cbf339a06d6ba5c2ef5a2..42e73a21c19e232788728e91134db94fd9c71633 100644 --- a/software/maarch/software.cfg +++ b/software/maarch/software.cfg @@ -13,8 +13,31 @@ parts += instance instance-apache-php slapos-recipe-maarch-egg + slapos.cookbook-repository + check-recipe +develop = + ${:parts-directory}/slapos.cookbook-repository + + +extensions = buildout-versions + + +[slapos.cookbook-repository] +recipe = slapos.recipe.build:gitclone +repository = http://git.erp5.org/repos/slapos.git +revision = 7dce435eca6fe2eeff60c865d41ee40db59257fa +git-executable = ${git:location}/bin/git + + +[check-recipe] +recipe = plone.recipe.command +stop-on-error = true +update-command = ${:command} +command = + grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link + #---------------- #-- diff --git a/stack/erp5/buildout.cfg b/stack/erp5/buildout.cfg index 8594d92d18c1d0789e31c6929ab159abbe180d0c..3972d654336f91c1f524c32ae9f5bb95b721864e 100644 --- a/stack/erp5/buildout.cfg +++ b/stack/erp5/buildout.cfg @@ -290,7 +290,7 @@ extra-context = [template-memcached] < = template-jinja2-base filename = instance-memcached.cfg -md5sum = 2de1801236eb78651ecfd50ada46dd3b +md5sum = 346c864c1f119360eddb5e163f16d4f3 extra-context = key dash_location dash:location key dcron_location dcron:location @@ -645,7 +645,7 @@ inotifyx = 0.2.0 ipdb = 0.7 ipython = 0.13.1 meld3 = 0.6.10 -mr.developer = 1.24 +mr.developer = 1.25 netaddr = 0.7.10 netifaces = 0.8 ordereddict = 1.1 @@ -658,7 +658,7 @@ pyPdf = 1.13 pyflakes = 0.6.1 python-ldap = 2.4.10 python-magic = 0.4.3 -qrcode = 2.4.2 +qrcode = 2.5.1 requests = 1.1.0 restkit = 4.2.1 rtjp-eventlet = 0.3.2 diff --git a/stack/erp5/instance-memcached.cfg.in b/stack/erp5/instance-memcached.cfg.in index f3f8401e03384e9e759033696dcc6f88559ba45e..7fc8f81c006f9e3c76481641ad74000cb05ab7ec 100644 --- a/stack/erp5/instance-memcached.cfg.in +++ b/stack/erp5/instance-memcached.cfg.in @@ -27,9 +27,9 @@ recipe = slapos.cookbook:generic.kumofs # Network options ip = ${slap-network-information:local-ipv4} -manager-port = 13101 -server-port = 13201 -server-listen-port = 13202 +manager-port = 13401 +server-port = 13501 +server-listen-port = 13502 # previous memcached configuration gateway-port = 11000 # previous memcached configuration diff --git a/stack/lapp/buildout.cfg b/stack/lapp/buildout.cfg index 673f746e7b43172a23ab34fab41eec2b8ab0d58e..4232978b4af32bf0c091565c80f4ca629ec012e8 100644 --- a/stack/lapp/buildout.cfg +++ b/stack/lapp/buildout.cfg @@ -311,100 +311,115 @@ signature-certificate-list = [versions] Jinja2 = 2.6 Werkzeug = 0.8.3 -apache-libcloud = 0.11.4 +apache-libcloud = 0.12.1 async = 0.6.1 buildout-versions = 1.7 +cp.recipe.cmd = 0.4 gitdb = 0.5.4 hexagonit.recipe.cmmi = 1.6 -inotifyx = 0.2.0 -lxml = 3.0.2 meld3 = 0.6.10 -netaddr = 0.7.10 -psycopg2 = 2.4.6 +plone.recipe.command = 1.1 pycrypto = 2.6 -pytz = 2012h rdiff-backup = 1.0.5 -slapos.cookbook = 0.72.0 +slapos.recipe.build = 0.11.6 slapos.recipe.download = 1.0.dev-r4053 slapos.recipe.template = 2.4.2 +slapos.toolbox = 0.33.1 smmap = 0.8.2 # Required by: -# slapos.core==0.33.2-dev -# slapos.toolbox==0.32.1-dev +# slapos.core==0.35.1 +# slapos.toolbox==0.33.1 Flask = 0.9 # Required by: -# slapos.toolbox==0.32.1-dev +# slapos.toolbox==0.33.1 GitPython = 0.3.2.RC1 # Required by: -# slapos.toolbox==0.32.1-dev +# slapos.toolbox==0.33.1 atomize = 0.1.1 # Required by: -# slapos.toolbox==0.32.1-dev +# slapos.toolbox==0.33.1 feedparser = 5.1.3 # Required by: -# hexagonit.recipe.cmmi==1.6 -hexagonit.recipe.download = 1.6nxd002 +# slapos.cookbook==0.74.1-dev +inotifyx = 0.2.0 # Required by: -# slapos.core==0.33.2-dev +# slapos.cookbook==0.74.1-dev +# slapos.core==0.35.1 +# xml-marshaller==0.9.7 +lxml = 3.1.0 + +# Required by: +# slapos.cookbook==0.74.1-dev +netaddr = 0.7.10 + +# Required by: +# slapos.core==0.35.1 netifaces = 0.8 # Required by: -# slapos.toolbox==0.32.1-dev -paramiko = 1.9.0 +# slapos.toolbox==0.33.1 +paramiko = 1.10.0 # Required by: -# slapos.toolbox==0.32.1-dev +# slapos.toolbox==0.33.1 psutil = 0.6.1 # Required by: -# slapos.core==0.33.2-dev -pyflakes = 0.5.0 +# slapos.recipe.maarch==0.4 +psycopg2 = 2.4.6 # Required by: -# slapos.cookbook==0.70.1-dev -# slapos.core==0.33.2-dev -# slapos.toolbox==0.32.1-dev +# slapos.core==0.35.1 +pyflakes = 0.6.1 + +# Required by: +# slapos.cookbook==0.74.1-dev +pytz = 2013b + +# Required by: +# slapos.cookbook==0.74.1-dev +# slapos.core==0.35.1 +# slapos.recipe.maarch==0.4 +# slapos.toolbox==0.33.1 # supervisor==3.0b1 # zc.buildout==1.6.0-dev-SlapOS-010 -# zope.interface==4.0.2 +# zope.interface==4.0.5 setuptools = 0.6c12dev-r88846 # Required by: -# slapos.core==0.33.2-dev -supervisor = 3.0b1 +# slapos.cookbook==0.74.1-dev +# slapos.toolbox==0.33.1 +slapos.core = 0.35.1 # Required by: -# slapos.toolbox==0.32.1-dev -xml-marshaller = 0.9.7 +# slapos.core==0.35.1 +supervisor = 3.0b1 # Required by: -# slapos.core==0.33.2-dev -zope.interface = 4.0.2 - -cp.recipe.cmd = 0.4 -plone.recipe.command = 1.1 -slapos.recipe.build = 0.11.5 -slapos.toolbox = 0.33 +# slapos.core==0.35.1 +unittest2 = 0.5.1 # Required by: -# slapos.toolbox==0.33 -slapos.core = 0.35 +# slapos.cookbook==0.74.1-dev +# slapos.toolbox==0.33.1 +xml-marshaller = 0.9.7 # Required by: -# slapos.core==0.35 -unittest2 = 0.5.1 +# zope.testing==4.1.2 +zope.exceptions = 4.0.6 # Required by: -# zope.testing==4.1.1 -zope.exceptions = 4.0.5 +# slapos.core==0.35.1 +# zope.testing==4.1.2 +zope.interface = 4.0.5 # Required by: # cp.recipe.cmd==0.4 -zope.testing = 4.1.1 +zope.testing = 4.1.2