From: Ansgar Burchardt Date: Thu, 20 Sep 2012 10:17:36 +0000 (+0200) Subject: daklib/command.py: process all sections and not only the first one X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=650ec31aaf1883f5f866b5245db14bdf4cf196f7;p=dak daklib/command.py: process all sections and not only the first one --- diff --git a/daklib/command.py b/daklib/command.py index a3092f6f..88f65558 100644 --- a/daklib/command.py +++ b/daklib/command.py @@ -62,20 +62,23 @@ class CommandFile(object): def _evaluate_sections(self, sections, session): session.rollback() try: - sections.next() - section = sections.section - - action = section.get('Action', None) - if action is None: - raise CommandError('Encountered section without Action field') - self.result.append('Action: {0}'.format(action)) - - if action == 'dm': - self.action_dm(self.fingerprint, section, session) - elif action == 'break-the-archive': - self.action_break_the_archive(self.fingerprint, section, session) - else: - raise CommandError('Unknown action: {0}'.format(action)) + while True: + sections.next() + section = sections.section + + action = section.get('Action', None) + if action is None: + raise CommandError('Encountered section without Action field') + self.result.append('Action: {0}'.format(action)) + + if action == 'dm': + self.action_dm(self.fingerprint, section, session) + elif action == 'break-the-archive': + self.action_break_the_archive(self.fingerprint, section, session) + else: + raise CommandError('Unknown action: {0}'.format(action)) + + self.result.append('') except StopIteration: pass finally: @@ -163,7 +166,6 @@ class CommandFile(object): self._notify_uploader() session.close() - self.log.log(['done', self.filename]) return result