pkg build modules throw better exception message if keyid wasn't found

This commit is contained in:
Denys Havrysh 2017-01-15 20:05:32 +02:00
parent 50d417f267
commit 53f2be5b21
2 changed files with 11 additions and 5 deletions

View file

@ -604,7 +604,8 @@ def make_repo(repodir,
except SaltInvocationError:
raise SaltInvocationError(
'Public and Private key files associated with Pillar data and \'keyid\' {0} could not be found'
'Public and Private key files associated with Pillar data and \'keyid\' '
'{0} could not be found'
.format(keyid)
)
@ -619,7 +620,8 @@ def make_repo(repodir,
if local_keyid is None:
raise SaltInvocationError(
'\'keyid\' was not found in gpg keyring'
'The key ID \'{0}\' was not found in GnuPG keyring at \'{1}\''
.format(keyid, gnupghome)
)
_check_repo_sign_utils_support()

View file

@ -425,7 +425,8 @@ def make_repo(repodir,
except SaltInvocationError:
raise SaltInvocationError(
'Public and Private key files associated with Pillar data and \'keyid\' {0} could not be found'
'Public and Private key files associated with Pillar data and \'keyid\' '
'{0} could not be found'
.format(keyid)
)
@ -440,14 +441,17 @@ def make_repo(repodir,
if local_keyid is None:
raise SaltInvocationError(
'\'keyid\' was not found in gpg keyring'
'The key ID \'{0}\' was not found in GnuPG keyring at \'{1}\''
.format(keyid, gnupghome)
)
if use_passphrase:
phrase = __salt__['pillar.get']('gpg_passphrase')
if local_uids:
define_gpg_name = '--define=\'%_signature gpg\' --define=\'%_gpg_name {0}\''.format(local_uids[0])
define_gpg_name = '--define=\'%_signature gpg\' --define=\'%_gpg_name {0}\''.format(
local_uids[0]
)
# need to update rpm with public key
cmd = 'rpm --import {0}'.format(pkg_pub_key_file)