#NEWLINE# @ click . command ( help = 'Rotate Keeper record' ) #NEWLINE# @ click . pass_obj #NEWLINE# @ click . option ( '--uid' , help = 'uid of the record to rotate the password on' ) #NEWLINE# @ click . option ( '--match' , help = 'regular expression to select records for password rotation' ) #NEWLINE# def rotate( params , uid , match ) : #NEWLINE# #INDENT# if ( not ( uid or match ) ) : #NEWLINE# #INDENT# raise click . ClickException ( 'Need to specify either uid or match option' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# api . sync_down ( params ) #NEWLINE# if uid : #NEWLINE# #INDENT# api . rotate_password ( params , uid ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if filter : #NEWLINE# #INDENT# results = api . search_records ( params , match ) #NEWLINE# for r in results : #NEWLINE# #INDENT# api . rotate_password ( params , e . record_uid ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# raise click . ClickException ( e )