def downloaded(name, artifact, target_dir='/tmp', target_file=None):
 log.debug(' ======================== STATE: artifactory.downloaded (name: %s) ', name)
 ret = {'name': name, 'result': True, 'changes': {}, 'comment': ''}
 try:
  fetch_result = __fetch_from_artifactory(artifact, target_dir, target_file)
  log.debug('fetch_result=%s', str(fetch_result))
  ret['result'] = fetch_result['status']
  ret['comment'] = fetch_result['comment']
  ret['changes'] = fetch_result['changes']
  log.debug('ret=%s', str(ret))
  return ret
 except Exception as exc:
  ret['result'] = False
  ret['comment'] = exc
  return ret

def downloaded ( name , artifact , target_dir = '/tmp' , target_file = None ) : log . debug ( ' ======================== STATE: artifactory.downloaded (name: %s) ' , name ) ret = { 'name' : name , 'result' : True , 'changes' : { } , 'comment' : '' } try : fetch_result = __fetch_from_artifactory ( artifact , target_dir , target_file ) log . debug ( 'fetch_result=%s' , str ( fetch_result ) ) ret [ 'result' ] = fetch_result [ 'status' ] ret [ 'comment' ] = fetch_result [ 'comment' ] ret [ 'changes' ] = fetch_result [ 'changes' ] log . debug ( 'ret=%s' , str ( ret ) ) return ret except Exception as exc : ret [ 'result' ] = False ret [ 'comment' ] = exc return ret
ensures that the artifact from artifactory exists at given location .