def gen_interfaces(): import commands ifile = defaults.interface_info() headers = defaults.headers() rebuild = False try: if os.stat(headers).st_mtime <= os.stat(ifile).st_mtime: return except OSError: pass if os.getuid() != 0: raise ValueError(_("You must regenerate interface info by running /usr/bin/sepolgen-ifgen")) print(commands.getstatusoutput("/usr/bin/sepolgen-ifgen")[1])
def gen_interfaces(): import commands ifile = defaults.interface_info() headers = defaults.headers() rebuild = False try: if os.stat(headers).st_mtime <= os.stat(ifile).st_mtime: return except OSError: pass if os.getuid() != 0: raise ValueError(_("You must regenerate interface info by running /usr/bin/sepolgen-ifgen")) print commands.getstatusoutput("/usr/bin/sepolgen-ifgen")[1]
def gen_interfaces(): ifile = defaults.interface_info() headers = defaults.headers() rebuild = False try: if os.stat(headers).st_mtime <= os.stat(ifile).st_mtime: return except OSError: pass if os.getuid() != 0: raise ValueError(_("You must regenerate interface info by running /usr/bin/sepolgen-ifgen")) print(subprocess.check_output("/usr/bin/sepolgen-ifgen", stderr=subprocess.STDOUT, shell=True))
def gen_interfaces(): try: from commands import getstatusoutput except ImportError: from subprocess import getstatusoutput ifile = defaults.interface_info() headers = defaults.headers() try: if os.stat(headers).st_mtime <= os.stat(ifile).st_mtime: return except OSError: pass if os.getuid() != 0: raise ValueError(_("You must regenerate interface info by running /usr/bin/sepolgen-ifgen")) print(getstatusoutput("/usr/bin/sepolgen-ifgen")[1])