예제 #1
0
    def process(self):
        # Load configuration
        ac = Authconfig(read_file('/etc/sysconfig/authconfig'))
        dconf = DConf(read_file('/etc/dconf/db/distro.d/10-authconfig'))
        pam = PAM.from_system_configuration()
        nsswitch = read_file("/etc/nsswitch.conf")

        scanner = AuthselectScannerLibrary(self.known_modules, ac, dconf, pam,
                                           nsswitch)

        self.produce(scanner.process())
예제 #2
0
    def process(self):
        for model in self.consume(RemovedPAMModules):
            for path in PAM.files:
                content = read_file(path)
                if not content:  # Nothing to do if no content?
                    continue

                with open(path, 'w') as f:
                    f.write(comment_modules(model.modules, content))
            break
예제 #3
0
def test_read_file__non_existent():
    content = read_file('/this/does/not/exist')
    assert content == ''
예제 #4
0
def test_read_file__ok():
    content = read_file(__file__)
    assert content != ''
    assert 'test_read_file__ok' in content