def fixture_disable_restricted_access(needs_root, load_cfg): """Disable console login restrictions.""" restricted_access = security.get_restricted_access_enabled() if restricted_access: security.set_restricted_access(False) yield security.set_restricted_access(True) else: yield
def setUp(self): """Setup each .""" current_directory = os.path.dirname(__file__) self.action_file = os.path.join(current_directory, '..', '..', '..', '..', 'actions', 'users') self.users = set() self.groups = set() self.restricted_access = security.get_restricted_access_enabled() if self.restricted_access: security.set_restricted_access(False)
def get_status(request): """Return the current status""" return {'restricted_access': security.get_restricted_access_enabled()}
def get_status(request): """Return the current status""" return { 'restricted_access': security.get_restricted_access_enabled(), 'fail2ban_enabled': action_utils.service_is_enabled('fail2ban') }