except IOError:
return -1
+def vm_healty_check(output_directory=None):
+ retry_count = int(os.getenv('MIC_APPLIANCE_RETRY_COUNT')) + 1
+ if retry_count > 3:
+ return
+ sys.stdout.flush()
+ for fname in os.listdir(output_directory):
+ if fname.endswith('.log'):
+ with open(os.path.join(output_directory, fname), 'r') as lg:
+ for ln in lg.read().splitlines():
+ if 'PYCURL ERROR 7' in ln and '/repomd.xml' in ln:
+ trigger_next('image_creator_retry',
+ data=trigger_info(os.getenv('TRIGGER_INFO')),
+ show=False,
+ extra_params={'MIC_APPLIANCE_RETRY_COUNT': str(retry_count)})
+ print 'VM NETWORKING DISABLED... RETRY %s.' % str(retry_count)
+ sys.exit(3)
+
def main():
"""The main body"""
except Exception as err:
print 'LOGCPERROR: %s' % err
+ if os.getenv('USE_VM', '0') != '0':
+ vm_healty_check(output_directory=os.path.join(sync_src, 'images', fields['repo'], name))
+
sync_status = 'success'
for loop in range(2):
if __name__ == "__main__":
sys.exit(main())
-