def restart_apache():
    try:
        check_apache_running()
        apache = subprocess.Popen(['apachectl', 'restart'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
    except __HOLE__:
        apache = subprocess.Popen(['apachectl', 'start'], stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
    apache.communicate()
    subprocess.call(['sleep', '3'])
dataset/ETHPy150Open nasa-gibs/onearth/src/test/oe_test_utils.py/restart_apache