def check_firefox_version():
 expected_firefox_ver = ('Mozilla Firefox ' + str(MINIMUM_FIREFOX_VERSION))
 firefox_ver_string = subprocess.check_output('firefox --version', shell=True).strip()
 firefox_version_regex = re.compile('Mozilla Firefox (\\d+.\\d+)')
 try:
  firefox_ver = float(firefox_version_regex.search(firefox_ver_string).group(1))
 except AttributeError:
  firefox_ver = 0.0
 debian_location = 'https://s3.amazonaws.com/vagrant.testeng.edx.org/'
 debian_package = 'firefox-mozilla-build_42.0-0ubuntu1_amd64.deb'
 debian_path = '{location}{package}'.format(location=debian_location, package=debian_package)
 if (firefox_ver < MINIMUM_FIREFOX_VERSION):
  raise Exception('Required firefox version not found.\nExpected: {expected_version}; Actual: {actual_version}.\n\nAs the vagrant user in devstack, run the following:\n\n DCTB $ sudo wget -O /tmp/firefox_42.deb {debian_path}\n DCTB $ sudo apt-get remove firefox\n\n DCTB $ sudo gdebi -nq /tmp/firefox_42.deb\n\nConfirm the new version:\n DCTB $ firefox --version\n DCTB {expected_version}'.format(actual_version=firefox_ver, expected_version=expected_firefox_ver, debian_path=debian_path))

def check_firefox_version ( ) : expected_firefox_ver = ( 'Mozilla Firefox ' + str ( MINIMUM_FIREFOX_VERSION ) ) firefox_ver_string = subprocess . check_output ( 'firefox --version' , shell = True ) . strip ( ) firefox_version_regex = re . compile ( 'Mozilla Firefox (\\d+.\\d+)' ) try : firefox_ver = float ( firefox_version_regex . search ( firefox_ver_string ) . group ( 1 ) ) except AttributeError : firefox_ver = 0.0 debian_location = 'https://s3.amazonaws.com/vagrant.testeng.edx.org/' debian_package = 'firefox-mozilla-build_42.0-0ubuntu1_amd64.deb' debian_path = '{location}{package}' . format ( location = debian_location , package = debian_package ) if ( firefox_ver < MINIMUM_FIREFOX_VERSION ) : raise Exception ( 'Required firefox version not found.\nExpected: {expected_version}; Actual: {actual_version}.\n\nAs the vagrant user in devstack, run the following:\n\n DCTB $ sudo wget -O /tmp/firefox_42.deb {debian_path}\n DCTB $ sudo apt-get remove firefox\n\n DCTB $ sudo gdebi -nq /tmp/firefox_42.deb\n\nConfirm the new version:\n DCTB $ firefox --version\n DCTB {expected_version}' . format ( actual_version = firefox_ver , expected_version = expected_firefox_ver , debian_path = debian_path ) )
check that firefox is the correct version .