def _gen_md5_filehash(fname, *args):
 _hash = hashlib.md5()
 with salt.utils.fopen(fname, 'rb') as f:
  for chunk in iter((lambda : f.read(4096)), ''):
   _hash.update(chunk)
 for extra_arg in args:
  _hash.update(str(extra_arg))
 return _hash.hexdigest()

def _gen_md5_filehash ( fname , * args ) : _hash = hashlib . md5 ( ) with salt . utils . fopen ( fname , 'rb' ) as f : for chunk in iter ( ( lambda : f . read ( 4096 ) ) , '' ) : _hash . update ( chunk ) for extra_arg in args : _hash . update ( str ( extra_arg ) ) return _hash . hexdigest ( )
helper function to generate a md5 hash of the swagger definition file any extra argument passed to the function is converted to a string and participates in the hash calculation .