예제 #1
0
def kotd_get_file_list():
    url = config.get('kotd', 'base_url').format(release=config.get('kotd', 'release'),
                                                arch=config.get('kotd', 'arch'))
    res = requests.get(url)
    if res.status_code not in [200, 201]:
        return None
    file_list = re.findall(r'[\w\-_.]+.rpm', res.text)
    file_list = list(set(file_list))
    return file_list
예제 #2
0
def kotd_get_file_list():
    url = config.get('kotd',
                     'base_url').format(release=config.get('kotd', 'release'),
                                        arch=config.get('kotd', 'arch'))
    res = requests.get(url)
    if res.status_code not in [200, 201]:
        return None
    file_list = re.findall(r'[\w\-_.]+.rpm', res.text)
    file_list = list(set(file_list))
    return file_list
예제 #3
0
def trigger(fullname, args={}, headers={}):
    names = fullname.split('/')
    jenkins_port = ":%s" % config.get('jenkins', 'port') if config.has_option('jenkins', 'port') else ''
    base_url = "http://%s%s" % (config.get('jenkins', 'host'), jenkins_port)
    url = "%s/%s" % (base_url,
                    ''.join(["job/%s/" % (item) for item in names]))
    res = requests.post(url, data=args, headers=headers)
    if res.status_code not in [200, 201, 202]:
        return False
    return True