File: //usr/lib/python3.9/site-packages/SSSDConfig/__pycache__/ipachangeconf.cpython-39.pyc
a
�,hpJ � @ sR d Z ddlZddlZddlZddlZd
dd�ZG dd� de�ZG dd � d e�ZdS )a
ipachangeconf - configuration file manipulation classes and functions
partially based on authconfig code
Copyright (c) 1999-2007 Red Hat, Inc.
Author: Simo Sorce <ssorce@redhat.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
� NTc C s� d}t j}|r|t jB }z t �| ||�}t�|tj� W nb ty� } zJ|j\}}|dkr|zt � |� W n tyz Y n0 t
||��W Y d }~n
d }~0 0 t �|d�S )N���zr+)�os�O_RDWR�O_CREAT�open�fcntl�lockfZLOCK_EX�OSError�args�close�IOError�fdopen)�filenameZpermsZcreate�fd�flags�err�errnoZstrerr� r �</usr/lib/python3.9/site-packages/SSSDConfig/ipachangeconf.py�
openLocked s
r c @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zedd� �Zd6d d!�Zd"d#� Zd7d%d&�Zd8d'd(�Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd1d2� Zd3d4� Zd5S )9�
IPAChangeConfc C sX || _ d| _d| _| jd | _d| _| jd | _d| _| jd | _d| _d| _ d| _
d S ) N)� r r )z = �=r )�#)�
)�[�])�{�}z.ipabkp)�progname�indent�assign�dassign�comment�dcomment�eol�deol�
sectnamdel�
subsectdel�
backup_suffix��self�namer r r �__init__2 s zIPAChangeConf.__init__c C s
|| _ d S �N)r r* r r r �setProgName? s zIPAChangeConf.setProgNamec C s6 t |�tu r|| _nt |�tu r*|f| _ntd��d S )Nz Indent must be a list of strings)�type�tupler �str�
ValueError)r+ r r r r � setIndentB s
zIPAChangeConf.setIndentc C s, t |�tu r|| _n|f| _| jd | _d S �Nr )r0 r1 r! r"