#NEWLINE# def is_valid_partition( name , partition , **kwargs ) : #NEWLINE# #INDENT# 'Valid the format of partition name.' #NEWLINE# if ( ( name != 'swap' ) and ( not name . startswith ( '/' ) ) ) : #NEWLINE# #INDENT# logging . debug ( '%s is not started with / or swap' , name ) #NEWLINE# return False #NEWLINE# #UNINDENT# if ( ( 'size' not in partition ) and ( 'percentage' not in partition ) ) : #NEWLINE# #INDENT# logging . debug ( '%s partition does not contain sie or percentage' , name ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True