def _setup_logging(): rootLogger = logging.getLogger() for handler in rootLogger.handlers: rootLogger.removeHandler(handler) logging.basicConfig(level=logging.DEBUG, format="%(levelname)-8s %(message)s") if utils.get_debug(): rootLogger.setLevel(logging.DEBUG) else: rootLogger.setLevel(logging.ERROR)
_set_distro(MandrivaDistro) # One old mandriva _add(MANDRIVA_URL % ("2010.2", "x86_64"), i686=MANDRIVA_URL % ("2010.2", "i586"), hasxen=False, name="mandriva-2010.2") testconn = utils.open_testdefault() hvmguest = Guest(testconn) hvmguest.os.os_type = "hvm" xenguest = Guest(testconn) xenguest.os.os_type = "xen" meter = urlgrabber.progress.BaseMeter() if utils.get_debug(): meter = urlgrabber.progress.TextMeter(fo=sys.stdout) def _storeForDistro(fetcher, guest): """ Helper to lookup the Distro store object, basically detecting the URL. Handle occasional proxy errors """ for ignore in range(0, 10): try: return urlfetcher.getDistroStore(guest, fetcher) except Exception, e: if str(e).count("502"): logging.debug("Caught proxy error: %s", str(e)) time.sleep(.5)
_add(OLD_UBUNTU_URL % ("raring", "amd64"), "ubuntu13.04") _set_distro(MandrivaDistro) # One old mandriva _add(MANDRIVA_URL % ("2010.2", "x86_64"), i686=MANDRIVA_URL % ("2010.2", "i586"), hasxen=False, name="mandriva-2010.2") testconn = utils.open_testdefault() hvmguest = Guest(testconn) hvmguest.os.os_type = "hvm" xenguest = Guest(testconn) xenguest.os.os_type = "xen" meter = util.make_meter(quiet=not utils.get_debug()) def _storeForDistro(fetcher, guest): """ Helper to lookup the Distro store object, basically detecting the URL. Handle occasional proxy errors """ for ignore in range(0, 10): try: return urlfetcher.getDistroStore(guest, fetcher) except Exception, e: if str(e).count("502"): logging.debug("Caught proxy error: %s", str(e)) time.sleep(.5) continue
# along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301 USA. import logging import os import virtinst from tests import utils # pylint: disable=W0212 # Access to protected member, needed to unittest stuff # Force certain helpers to return consistent values virtinst.util.is_blktap_capable = lambda: False virtinst.util.default_bridge = lambda ignore1: ["bridge", "eth0"] virtinst.Guest._open_uri = lambda ignore1, ignore2: None # Setup logging rootLogger = logging.getLogger() for handler in rootLogger.handlers: rootLogger.removeHandler(handler) logging.basicConfig(level=logging.DEBUG, format="%(levelname)-8s %(message)s") if utils.get_debug(): rootLogger.setLevel(logging.DEBUG) else: rootLogger.setLevel(logging.ERROR)
def setUp(self): self.meter = urlgrabber.progress.BaseMeter() if utils.get_debug(): self.meter = urlgrabber.progress.TextMeter(fo=sys.stdout)
_set_distro(MandrivaDistro) # One old mandriva _add(MANDRIVA_URL % ("2010.2", "x86_64"), i686=MANDRIVA_URL % ("2010.2", "i586"), hasxen=False, name="mandriva-2010.2") testconn = utils.open_testdefault() hvmguest = Guest(testconn) hvmguest.os.os_type = "hvm" xenguest = Guest(testconn) xenguest.os.os_type = "xen" meter = util.make_meter(quiet=not utils.get_debug()) def _storeForDistro(fetcher, guest): """ Helper to lookup the Distro store object, basically detecting the URL. Handle occasional proxy errors """ for ignore in range(0, 10): try: return urlfetcher.getDistroStore(guest, fetcher) except Exception, e: if str(e).count("502"): logging.debug("Caught proxy error: %s", str(e)) time.sleep(.5) continue