+ parsed_url = urlparse.urlparse(image_file)
+ if parsed_url.scheme == "" and parsed_url.netloc == "":
+ # The path is a local file
+ if os.path.exists(image_file):
+ http_content['image']['checksum'] = md5(image_file)
+ else:
+ # The path is a URL. Code should be added to download the image and calculate the checksum
+ #http_content['image']['checksum'] = md5(downloaded_image)
+ pass
+ # Finally, only if we are in test mode and checksum has not been calculated, we calculate it from the path
+ host_test_mode = True if config_dic['mode']=='test' or config_dic['mode']=="OF only" else False
+ if host_test_mode:
+ if 'checksum' not in http_content['image']:
+ http_content['image']['checksum'] = md5_string(image_file)