Source code for libka.kci
#!/usr/bin/python3
# kate: space-indent on; indent-width 4; replace-tabs on; indent-mode python; remove-trailing-space modified;
# vim: expandtab ts=4
############################################################################
# Copyright © 2018 José Manuel Santamaría Lema <panfaust@gmail.com> #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
############################################################################
import urllib3
import json
from libka.ka_print import *
[docs]
def is_kci_paused():
kci_pause_url = 'http://kci.pangea.pub/job/mgmt_pause_integration/lastBuild/api/json'
http = urllib3.PoolManager()
r = http.request('GET', kci_pause_url)
if r.status != 200:
ka_print_error("Failed to access %s" % (kci_pause_url,))
ka_print_error("HTTP return code: %s" % (r.status,))
sys.exit(1)
r_json = json.loads(r.data)
return r_json['building']