#NEWLINE# def validate( dic , option_list ) : #NEWLINE# #INDENT# '\n\tdroplet actions command validation\n\t' #NEWLINE# for key in dic . viewkeys ( ) : #NEWLINE# #INDENT# if ( key in option_list ) : #NEWLINE# #INDENT# for option in option_list : #NEWLINE# #INDENT# if ( option != key ) : #NEWLINE# #INDENT# if ( dic [ option ] and dic [ option_list ] ) : #NEWLINE# #INDENT# raise click . UsageError ( ( 'Invalid option combination --%s \t\t\t\t\t\t\tcannot be used with --%s' % ( option , key ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if ( ( dic [ 'restore' ] and ( not dic [ 'backup_id' ] ) ) or ( dic [ 'backup_id' ] and ( not dic [ 'restore' ] ) ) ) : #NEWLINE# #INDENT# raise click . UsageError ( '--restore option requires --backup-id' ) #NEWLINE# #UNINDENT# if ( ( dic [ 'resize' ] and ( not dic [ 'size' ] ) ) or ( dic [ 'size' ] and ( not dic [ 'resize' ] ) ) ) : #NEWLINE# #INDENT# raise click . UsageError ( '--resize option requires --size' ) #NEWLINE# #UNINDENT# if ( ( dic [ 'rebuild' ] and ( not dic [ 'image' ] ) ) or ( dic [ 'image' ] and ( not dic [ 'rebuild' ] ) ) ) : #NEWLINE# #INDENT# raise click . UsageError ( '--rebuild option requires --image' ) #NEWLINE# #UNINDENT# if ( ( dic [ 'rename' ] and ( not dic [ 'name' ] ) ) or ( dic [ 'name' ] and ( not dic [ 'rename' ] ) ) ) : #NEWLINE# #INDENT# raise click . UsageError ( '--rename option requires --name' ) #NEWLINE# #UNINDENT# if ( ( dic [ 'change_kernel' ] and ( not dic [ 'kernel' ] ) ) or ( dic [ 'kernel' ] and ( not dic [ 'change_kernel' ] ) ) ) : #NEWLINE# #INDENT# raise click . UsageError ( '--change-kernel option requires --kernel' ) #NEWLINE# #UNINDENT# if ( ( dic [ 'snapshot' ] and ( not dic [ 'sname' ] ) ) or ( dic [ 'sname' ] and ( not dic [ 'snapshot' ] ) ) ) : #NEWLINE# #INDENT# raise click . UsageError ( '--snapshot option requires --sname' ) #NEWLINE# #UNINDENT# return True