def apt_key_exists(keyid):
 _validate_apt_key(keyid)
 gpg_cmd = 'gpg --ignore-time-conflict --no-options --no-default-keyring --keyring /etc/apt/trusted.gpg'
 with settings(hide('everything'), warn_only=True):
  res = run(('%(gpg_cmd)s --fingerprint %(keyid)s' % locals()))
 return res.succeeded

def apt_key_exists ( keyid ) : _validate_apt_key ( keyid ) gpg_cmd = 'gpg --ignore-time-conflict --no-options --no-default-keyring --keyring /etc/apt/trusted.gpg' with settings ( hide ( 'everything' ) , warn_only = True ) : res = run ( ( '%(gpg_cmd)s --fingerprint %(keyid)s' % locals ( ) ) ) return res . succeeded
check if the given key id exists in apt keyring .