def process(self):
        (opts, args) = getopts()
        chkopts(opts)
        self.up_progress(10)

        conn = KaresansuiVirtConnection(readonly=False)
        try:
            conn.set_domain_name(opts.name)
            active_guests = conn.list_active_guest()
            inactive_guests = conn.list_inactive_guest()
            if opts.name in active_guests or opts.name in inactive_guests:
                try:
                    self.up_progress(10)
                    conn.resume_guest()
                    self.up_progress(30)
                except Exception, e:
                    self.logger.error('Failed to resume guest. - dom=%s' % (opts.name))
                    print >>sys.stderr, _('Failed to resume guest. - dom=%s') % (opts.name)
                    raise e

                self.up_progress(10)
                status = conn.guest.status()
                self.up_progress(10)
                if status != VIR_DOMAIN_PAUSED:
                    self.logger.info('Succeeded to resume guest. - dom=%s' % (opts.name))
                    print >>sys.stdout, _('Succeeded to resume guest. - dom=%s') % (opts.name)

            else:
                self.logger.error('Guest not found. - dom=%s' % (opts.name))
                print >>sys.stderr, _('Guest not found. - dom=%s') % (opts.name)
                return False

            return True

        finally:
            conn.close()
dataset/ETHPy150Open karesansui/karesansui/bin/resume_guest.py/ResumeGuest.process/original