fcntl.flock(self.fd, fcntl.LOCK_UN)
def write_signed(self, name):
- sio = StringIO.StringIO()
+ sio = StringIO()
self._write_to(sio)
sio.seek(0)
sio.write(gpg.sign(sio.read()))
b.log_line("upgrade would need removal of %s" % k)
return False
b.log_line("upgrading packages")
- logbuf = StringIO.StringIO()
+ logbuf = StringIO()
res = chroot.run("rpm -Fvh %s" % ' '.join(b.files), user = "root", logfile = b.logfile)
if res != 0:
b.log_line("package upgrade failed")
class Message:
def __init__(self):
self.headers = {}
- self.body = StringIO.StringIO()
+ self.body = StringIO()
self.set_std_headers()
def set_header(self, n, v):
class Notifier:
def __init__(self, g):
- self.xml = StringIO.StringIO()
+ self.xml = StringIO()
self.xml.write("<notification group-id='%s' builder='%s'>\n" % \
(g.id, config.builder))
def send(self, r):
- sio = StringIO.StringIO()
+ sio = StringIO()
self.xml.write("</notification>\n")
self.xml.seek(0)
sio.write(gpg.sign(self.xml.read()))
from io import StringIO
def rw_pipe(buf_, infd, outfd):
- buf = StringIO.StringIO()
+ buf = StringIO()
buf.write(buf_.read())
- ret = StringIO.StringIO()
+ ret = StringIO()
pos = 0
rd_fin = 0
wr_fin = 0
signal.alarm(0)
log.error("can't fetch %s: %s" % (control_url + "/queue.gz", e))
sys.exit(1)
- sio = StringIO.StringIO()
+ sio = StringIO()
util.sendfile(f, sio)
f.close()
sio.seek(0)
exctype, value = sys.exc_info()[:2]
if exctype == SystemExit:
sys.exit(value)
- s = StringIO.StringIO()
+ s = StringIO()
traceback.print_exc(file = s, limit = 20)
log.alert("fatal python exception")