comparison bitten/slave.py @ 57:ef78d71667ad

Added simple helper class for executing commandline programs.
author cmlenz
date Mon, 27 Jun 2005 11:19:54 +0000
parents 033366d81def
children 055a6c666fa8
comparison
equal deleted inserted replaced
56:033366d81def 57:ef78d71667ad
106 logging.debug('Received snapshot archive: %s', archive_path) 106 logging.debug('Received snapshot archive: %s', archive_path)
107 107
108 # Unpack the archive 108 # Unpack the archive
109 prefix = archive.unpack(archive_path, workdir) 109 prefix = archive.unpack(archive_path, workdir)
110 path = os.path.join(workdir, prefix) 110 path = os.path.join(workdir, prefix)
111 logging.info('Unpacked snapshot to %s' % path) 111 logging.debug('Unpacked snapshot to %s' % path)
112 112
113 # Fix permissions 113 # Fix permissions
114 for root, dirs, files in os.walk(workdir, topdown=False): 114 for root, dirs, files in os.walk(workdir, topdown=False):
115 for dirname in dirs: 115 for dirname in dirs:
116 os.chmod(os.path.join(root, dirname), 0700) 116 os.chmod(os.path.join(root, dirname), 0700)
132 logging.info('Executing build step "%s"', step.id) 132 logging.info('Executing build step "%s"', step.id)
133 try: 133 try:
134 for function, args in step: 134 for function, args in step:
135 logging.debug('Executing command "%s"', function) 135 logging.debug('Executing command "%s"', function)
136 function(recipe.basedir, **args) 136 function(recipe.basedir, **args)
137
138 xml = xmlio.Element('step', id=step.id, result='success', 137 xml = xmlio.Element('step', id=step.id, result='success',
139 description=step.description) 138 description=step.description)
140 self.channel.send_ans(msgno, beep.MIMEMessage(xml)) 139 self.channel.send_ans(msgno, beep.MIMEMessage(xml))
141 except BuildError, e: 140 except BuildError, e:
142 xml = xmlio.Element('step', id=step.id, result='failure', 141 xml = xmlio.Element('step', id=step.id, result='failure',
Copyright (C) 2012-2017 Edgewall Software