@ -852,7 +852,19 @@ class AutopkgtestPolicy(BasePolicy):
try :
try :
with tarfile . open ( None , ' r ' , tar_bytes ) as tar :
with tarfile . open ( None , ' r ' , tar_bytes ) as tar :
exitcode = int ( tar . extractfile ( ' exitcode ' ) . read ( ) . strip ( ) )
exitcode = int ( tar . extractfile ( ' exitcode ' ) . read ( ) . strip ( ) )
try :
srcver = tar . extractfile ( ' testpkg-version ' ) . read ( ) . decode ( ) . strip ( )
srcver = tar . extractfile ( ' testpkg-version ' ) . read ( ) . decode ( ) . strip ( )
except KeyError as e :
# We have some buggy results in Ubuntu's swift that break a
# full reimport. Sometimes we fake up the exit code (when
# we want to convert tmpfails to permanent fails), but an
# early bug meant we sometimes didn't include a
# testpkg-version.
if exitcode in ( 4 , 12 , 20 ) :
# repair it
srcver = " %s unknown " % ( src )
else :
raise
( ressrc , ver ) = srcver . split ( )
( ressrc , ver ) = srcver . split ( )
testinfo = json . loads ( tar . extractfile ( ' testinfo.json ' ) . read ( ) . decode ( ) )
testinfo = json . loads ( tar . extractfile ( ' testinfo.json ' ) . read ( ) . decode ( ) )
except ( KeyError , ValueError , tarfile . TarError ) as e :
except ( KeyError , ValueError , tarfile . TarError ) as e :