# Path: pyanaconda/flags.py
# class Flags(object):
# class BootArgs(OrderedDict):
#     def __setattr__(self, attr, val):
#     def get(self, attr, val=None):
#     def set_cmdline_bool(self, flag):
#     def __init__(self, read_cmdline=True):
#     def read_cmdline(self):
#     def __init__(self, cmdline=None, files=None):
#     def read(self, filenames):
#     def readstr(self, cmdline):
#     def getbool(self, arg, default=False):
# def can_touch_runtime_system(msg, touch_live=False):
# 
# Path: pyanaconda/constants.py
# DRACUT_SHUTDOWN_EJECT = "/run/initramfs/usr/lib/dracut/hooks/shutdown/99anaconda-eject.sh"
# 
# ROOT_PATH = "/mnt/sysimage"
# 
# TRANSLATIONS_UPDATE_DIR="/tmp/updates/po"
# 
# UNSUPPORTED_HW = 1 << 28
# 
# Path: pyanaconda/anaconda_log.py
# DEFAULT_TTY_LEVEL = logging.INFO
# ENTRY_FORMAT = "%(asctime)s,%(msecs)03d %(levelname)s %(name)s: %(message)s"
# TTY_FORMAT = "%(levelname)s %(name)s: %(message)s"
# STDOUT_FORMAT = "%(asctime)s %(message)s"
# DATE_FORMAT = "%H:%M:%S"
# MAIN_LOG_FILE = "/tmp/anaconda.log"
# MAIN_LOG_TTY = "/dev/tty3"
# PROGRAM_LOG_FILE = "/tmp/program.log"
# PROGRAM_LOG_TTY = "/dev/tty5"
# STORAGE_LOG_FILE = "/tmp/storage.log"
# PACKAGING_LOG_FILE = "/tmp/packaging.log"
# SENSITIVE_INFO_LOG_FILE = "/tmp/sensitive-info.log"
# ANACONDA_SYSLOG_FACILITY = SysLogHandler.LOG_LOCAL1
#     SYSLOG_CFGFILE  = "/etc/rsyslog.conf"
#     VIRTIO_PORT = "/dev/virtio-ports/org.fedoraproject.anaconda.log.0"
#         TEMPLATE = "*.* @@%s\n"
#         TEMPLATE = "*.* %s;anaconda_syslog\n"
# def autoSetLevel(handler, value):
# def setHandlersLevel(logr, level):
#     def __init__(self,
#                  address=('localhost', SYSLOG_UDP_PORT),
#                  facility=SysLogHandler.LOG_USER,
#                  tag=''):
#     def emit(self, record):
#     def __init__ (self):
#     def addFileHandler (self, dest, addToLogger, minLevel=DEFAULT_TTY_LEVEL,
#                         fmtStr=ENTRY_FORMAT,
#                         autoLevel=False):
#     def forwardToSyslog(self, logr):
#     def showwarning(self, message, category, filename, lineno,
#                       file=sys.stderr, line=None):
#     def restartSyslog(self):
#     def updateRemote(self, remote_syslog):
#     def setupVirtio(self):
# def init():
# class AnacondaSyslogHandler(SysLogHandler):
# class AnacondaLog:


import glob
import os
import stat
import os.path
import errno
import subprocess
import unicodedata
import string
import types
import logging
from threading import Thread
from Queue import Queue, Empty
from pyanaconda.flags import flags
from pyanaconda.constants import DRACUT_SHUTDOWN_EJECT, ROOT_PATH, TRANSLATIONS_UPDATE_DIR, UNSUPPORTED_HW
from pyanaconda.regexes import PROXY_URL_PARSE
from pyanaconda.anaconda_log import program_log_lock
    ret = execWithRedirect("systemctl", [command, service_name])

    return ret

def start_service(service):
    return _run_systemctl("start", service)

def stop_service(service):
    return _run_systemctl("stop", service)

def restart_service(service):
    return _run_systemctl("restart", service)

def service_running(service):
    ret = _run_systemctl("status", service)

    return ret == 0

def dracut_eject(device):
    """
    Use dracut shutdown hook to eject media after the system is shutdown.
    This is needed because we are running from the squashfs.img on the media
    so ejecting too early will crash the installer.
    """
    if not device:
        return

    try:
        if not os.path.exists(DRACUT_SHUTDOWN_EJECT):
            mkdirChain(os.path.dirname(DRACUT_SHUTDOWN_EJECT))

# Path: pyanaconda/flags.py
# class Flags(object):
# class BootArgs(OrderedDict):
#     def __setattr__(self, attr, val):
#     def get(self, attr, val=None):
#     def set_cmdline_bool(self, flag):
#     def __init__(self, read_cmdline=True):
#     def read_cmdline(self):
#     def __init__(self, cmdline=None, files=None):
#     def read(self, filenames):
#     def readstr(self, cmdline):
#     def getbool(self, arg, default=False):
# def can_touch_runtime_system(msg, touch_live=False):
# 
# Path: pyanaconda/constants.py
# DRACUT_SHUTDOWN_EJECT = "/run/initramfs/usr/lib/dracut/hooks/shutdown/99anaconda-eject.sh"
# 
# ROOT_PATH = "/mnt/sysimage"
# 
# TRANSLATIONS_UPDATE_DIR="/tmp/updates/po"
# 
# UNSUPPORTED_HW = 1 << 28
# 
# Path: pyanaconda/anaconda_log.py
# DEFAULT_TTY_LEVEL = logging.INFO
# ENTRY_FORMAT = "%(asctime)s,%(msecs)03d %(levelname)s %(name)s: %(message)s"
# TTY_FORMAT = "%(levelname)s %(name)s: %(message)s"
# STDOUT_FORMAT = "%(asctime)s %(message)s"
# DATE_FORMAT = "%H:%M:%S"
# MAIN_LOG_FILE = "/tmp/anaconda.log"
# MAIN_LOG_TTY = "/dev/tty3"
# PROGRAM_LOG_FILE = "/tmp/program.log"
# PROGRAM_LOG_TTY = "/dev/tty5"
# STORAGE_LOG_FILE = "/tmp/storage.log"
# PACKAGING_LOG_FILE = "/tmp/packaging.log"
# SENSITIVE_INFO_LOG_FILE = "/tmp/sensitive-info.log"
# ANACONDA_SYSLOG_FACILITY = SysLogHandler.LOG_LOCAL1
#     SYSLOG_CFGFILE  = "/etc/rsyslog.conf"
#     VIRTIO_PORT = "/dev/virtio-ports/org.fedoraproject.anaconda.log.0"
#         TEMPLATE = "*.* @@%s\n"
#         TEMPLATE = "*.* %s;anaconda_syslog\n"
# def autoSetLevel(handler, value):
# def setHandlersLevel(logr, level):
#     def __init__(self,
#                  address=('localhost', SYSLOG_UDP_PORT),
#                  facility=SysLogHandler.LOG_USER,
#                  tag=''):
#     def emit(self, record):
#     def __init__ (self):
#     def addFileHandler (self, dest, addToLogger, minLevel=DEFAULT_TTY_LEVEL,
#                         fmtStr=ENTRY_FORMAT,
#                         autoLevel=False):
#     def forwardToSyslog(self, logr):
#     def showwarning(self, message, category, filename, lineno,
#                       file=sys.stderr, line=None):
#     def restartSyslog(self):
#     def updateRemote(self, remote_syslog):
#     def setupVirtio(self):
# def init():
# class AnacondaSyslogHandler(SysLogHandler):
# class AnacondaLog:


# Path: pyanaconda/iutil.py
import glob
import os
import stat
import os.path
import errno
import subprocess
import unicodedata
import string
import types
import logging
from threading import Thread
from Queue import Queue, Empty
from pyanaconda.flags import flags
from pyanaconda.constants import DRACUT_SHUTDOWN_EJECT, ROOT_PATH, TRANSLATIONS_UPDATE_DIR, UNSUPPORTED_HW
from pyanaconda.regexes import PROXY_URL_PARSE
from pyanaconda.anaconda_log import program_log_lock

    ret = execWithRedirect("systemctl", [command, service_name])

    return ret

def start_service(service):
    return _run_systemctl("start", service)

def stop_service(service):
    return _run_systemctl("stop", service)

def restart_service(service):
    return _run_systemctl("restart", service)

def service_running(service):
    ret = _run_systemctl("status", service)

    return ret == 0

def dracut_eject(device):
    """
    Use dracut shutdown hook to eject media after the system is shutdown.
    This is needed because we are running from the squashfs.img on the media
    so ejecting too early will crash the installer.
    """
    if not device:
        return

    try:
        if not os.path.exists(DRACUT_SHUTDOWN_EJECT):
            mkdirChain(os.path.dirname(DRACUT_SHUTDOWN_EJECT))

            f = open(DRACUT_SHUTDOWN_EJECT, "w")