#NEWLINE# def get_version( self ) : #NEWLINE# #INDENT# 'Return version of Apache Server.\n\n        Version is returned as tuple. (ie. 2.4.7 = (2, 4, 7))\n\n        :returns: version\n        :rtype: tuple\n\n        :raises .PluginError: if unable to find Apache version\n\n        ' #NEWLINE# try : #NEWLINE# #INDENT# ( stdout , _ ) = le_util . run_script ( constants . os_constant ( 'version_cmd' ) ) #NEWLINE# #UNINDENT# except errors . SubprocessError : #NEWLINE# #INDENT# raise errors . PluginError ( ( 'Unable to run %s -v' % constants . os_constant ( 'version_cmd' ) ) ) #NEWLINE# #UNINDENT# regex = re . compile ( 'Apache/([0-9\\.]*)' , re . IGNORECASE ) #NEWLINE# matches = regex . findall ( stdout ) #NEWLINE# if ( len ( matches ) != 1 ) : #NEWLINE# #INDENT# raise errors . PluginError ( 'Unable to find Apache version' ) #NEWLINE# #UNINDENT# return tuple ( [ int ( i ) for i in matches [ 0 ] . split ( '.' ) ] )