def _fetch_secret(pass_path):
 cmd = 'pass show {0}'.format(pass_path.strip())
 log.debug('Fetching secret: {0}'.format(cmd))
 proc = Popen(cmd.split(' '), stdout=PIPE, stderr=PIPE)
 (pass_data, pass_error) = proc.communicate()
 if (proc.returncode or (not pass_data)):
  msg = 'Could not fetch secret: {0} {1}'.format(pass_data, pass_error)
  log.warn(msg)
  pass_data = pass_path
 return pass_data.strip()

def _fetch_secret ( pass_path ) : cmd = 'pass show {0}' . format ( pass_path . strip ( ) ) log . debug ( 'Fetching secret: {0}' . format ( cmd ) ) proc = Popen ( cmd . split ( ' ' ) , stdout = PIPE , stderr = PIPE ) ( pass_data , pass_error ) = proc . communicate ( ) if ( proc . returncode or ( not pass_data ) ) : msg = 'Could not fetch secret: {0} {1}' . format ( pass_data , pass_error ) log . warn ( msg ) pass_data = pass_path return pass_data . strip ( )
fetch secret from pass based on pass_path .