File: //lib/python3.6/site-packages/ipaplatform/redhat/__pycache__/authconfig.cpython-36.opt-1.pyc
3
�d[e>4 � @ s� d dl mZ d dlZd dlZd dlZd dlmZ d dlmZ d dl m
Z
d dlZd dlZdddd gZ
eje�Zd
d� Zejej�G dd
� d
��ZG dd� de�ZG dd� de�ZdS )� )�absolute_importN)�paths)�ipautil)�ScriptErrorZpasswd�groupZshadowZgshadowc C s t � S )N)�RedHatAuthSelect� r r � /usr/lib/python3.6/authconfig.py�
get_auth_tool% s r
c @ sT e Zd Zejd
dd��Zejdd� �Zejdd� �Zejdd � �Zejd
d� �Z dS )�RedHatAuthToolBaseTc C s d S )Nr )�self�sssd� mkhomedir�
statestore�sudor r r � configure, s zRedHatAuthToolBase.configurec C s d S )Nr )r �fstorer �was_sssd_installed�was_sssd_configuredr r r �unconfigure0 s zRedHatAuthToolBase.unconfigurec C s dS )z�
Backup the system authentication resources configuration
:param path: directory where the backup will be stored
Nr )r �pathr r r �backup6 s zRedHatAuthToolBase.backupc C s dS )z�
Restore the system authentication resources configuration from a backup
:param path: directory where the backup is stored
Nr )r r r r r �restore= s zRedHatAuthToolBase.restorec C s d S )Nr )r � nisdomainr r r �
set_nisdomainD s z RedHatAuthToolBase.set_nisdomainN)T)
�__name__�
__module__�__qualname__�abc�abstractmethodr r r r r r r r r r ) s r c @ sH e Zd Zdd� Zddd�Zddd �Zd
d� Zdd
� Zdd� Zdd� Z dS )r c C sB yt jtjddg�}W n t jk
r6 tjd� d S X |jj� S )N�currentz--rawz/Current configuration not managed by authselect) r �runr �
AUTHSELECT�CalledProcessError�logger�debugZ
raw_output�decode)r r r r r �_get_authselect_current_outputK s
z/RedHatAuthSelect._get_authselect_current_outputNc C sR |dkr| j � }|dkrdS |j� }|s,dS |jd�}|d }|dd� }||fS )z�
Parses the output_text to extract the profile and options.
When no text is provided, runs the 'authselect profile' command to
generate the text to be parsed.
N� r � )r'