mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Raise exception if --pubkeys not given while delegating
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
This commit is contained in:
parent
e6dcb27efc
commit
5ff7a5ea84
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