#NEWLINE# def split_and_deserialize( string ) : #NEWLINE# #INDENT# "Split and try to JSON deserialize a string.\n\n    Gets a string with the KEY=VALUE format, split it (using '=' as the\n    separator) and try to JSON deserialize the VALUE.\n\n    :returns: A tuple of (key, value).\n    " #NEWLINE# try : #NEWLINE# #INDENT# ( key , value ) = string . split ( '=' , 1 ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise exc . CommandError ( ( _ ( 'Attributes must be a list of PATH=VALUE not "%s"' ) % string ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# value = json . loads ( value ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# return ( key , value )