def get_installation_url(release, arch): url = kotd_config.get('install', 'repo') url = kotd_utils.url_join(url, release, arch, '/') links = kotd_utils.get_links(url) print links for item in links: if item.endswith('DVD1/') or item.endswith('dvd1/'): return item raise StandardError("Couldn't find proper installation link in %s" % (url))
#!/usr/bin/env python import logging import kotd_config def config(**kwargs): if isinstance(kwargs['level'], basestring): kwargs['level'] = getattr(logging, kwargs['level']) logging.basicConfig(**kwargs) def get_logger(name, level=None): logger = logging.getLogger(name) if level is not None: level = getattr(logging, level) logger.setLevel(level) return logger config(level=kotd_config.get('log', 'level'))
def reinstall(ip, port=22, username=None, password=None, timeout=None): repo = kotd_config.get('install', 'repo') return run_shell(ip, "/usr/share/qa/tools/install.pl '%s' -f ext3" % (repo))