mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Merge pull request #645 from vladimir-v-diaz/require_pubkeys_when_delegating
Raise exception if --pubkeys not given while delegating
This commit is contained in:
commit
e0aacb29b1
1 changed files with 6 additions and 1 deletions
|
|
@ -145,12 +145,17 @@ def process_arguments(parsed_arguments):
|
|||
def delegate(parsed_arguments):
|
||||
|
||||
if not parsed_arguments.delegatee:
|
||||
raise tuf.exceptions.Error('--delegatee must be set to perform a delegation.')
|
||||
raise tuf.exceptions.Error(
|
||||
'--delegatee must be set to perform the delegation.')
|
||||
|
||||
if parsed_arguments.delegatee in ['root', 'snapshot', 'timestamp', 'targets']:
|
||||
raise tuf.exceptions.Error(
|
||||
'Cannot delegate to the top-level role: ' + repr(parsed_arguments.delegatee))
|
||||
|
||||
if not parsed_arguments.pubkeys:
|
||||
raise tuf.exceptions.Error(
|
||||
'--pubkeys must be set to perform the delegation.')
|
||||
|
||||
public_keys = []
|
||||
for public_key in parsed_arguments.pubkeys:
|
||||
# In the future, any type of key can be imported...
|
||||
|
|
|
|||
Loading…
Reference in a new issue