~javier.collado/utah/initctl-unity8

« back to all changes in this revision

Viewing changes to utah/client/runner.py

  • Committer: Andy Doan
  • Date: 2013-07-12 20:43:09 UTC
  • mfrom: (965.3.8 touch-networking)
  • Revision ID: andy.doan@canonical.com-20130712204309-gwmiq9l2w4o8966a
Tags: 0.14.1
fixes needed for touch and reboot edge cases

Show diffs side-by-side

added added

removed removed

Lines of Context:
552
552
        return self.get_next_suite().get_next_test()
553
553
 
554
554
    def _autorun_file(self):
555
 
        """Determine if this was launched via the autorun feature."""
 
555
        """Determine if this was launched via the autorun feature.
 
556
 
 
557
        :return: the autorun file or None
 
558
 
 
559
        """
556
560
        r = os.listdir('/var/cache/utah/autorun/inprogress')
557
561
        if len(r) == 1 and 'run-utah' in r[0]:
558
562
            return r[0]
592
596
            self.setup_rc_local(runlist=self.backup_runlist)
593
597
 
594
598
        try:
595
 
            subprocess.call(['shutdown', '-r', 'now'])
 
599
            # let the shutdown run in the background in a few seconds to allow
 
600
            # the client enough time to properly send an exit code back to
 
601
            # the server
 
602
            subprocess.call('(sleep 3; shutdown -r now)&', shell=True)
596
603
        except OSError as err:
597
604
            raise exceptions.UTAHClientError('Failed to reboot: {}'
598
605
                                             .format(err))