File: //lib/python2.7/site-packages/leapp/actors/config.pyo
�
9�Egc @ sX d Z e Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l
Z
d d l Z d d l m
Z
y d d l m Z Wn! e k
r� d d l m Z n Xd a e j d � Z d e f d � � YZ d
e f d � � YZ e
j e j � d d d
� � Y� Z d � Z d d � Z d � Z d � Z d � Z d � Z d � Z! d S( sj
Config file format:
yaml file like this:
---
# Note: have to add a fields.Map type before we can use yaml mappings.
section_name:
field1_name: value
field2_name:
- listitem1
- listitem2
section2_name:
field3_name: value
Config files are any yaml files in /etc/leapp/actor_config.d/
(This is settable in /etc/leapp/leapp.conf)
i����N( t defaultdict( t ModelViolationError( t CSafeLoader( t
SafeLoaders leapp.actors.configt SchemaErrorc B s e Z d Z RS( s�
Raised when actors use conflicting schemas.
For example, one schema wants `section.field` to be an integer and other schema wants
`section.field` to be a string.
( t __name__t
__module__t __doc__( ( ( s7 /usr/lib/python2.7/site-packages/leapp/actors/config.pyR - s t ValidationErrorc B s e Z d Z RS( s[
Raised when a config file fails to validate against any of the available schemas.
( R R R ( ( ( s7 /usr/lib/python2.7/site-packages/leapp/actors/config.pyR 6 s t Configc B s� e Z d Z e j d � � Z e j d � � Z e j d � � Z e j d � � Z e j d � � Z e
d � � Z e
d � � Z RS( s
An Actor config schema looks like this.
::
class RHUIConfig(Config):
section = "rhui"
name = "file_map"
type_ = fields.Map(fields.String())
description = 'Description here'
default = {"repo": "url"}
c C s d S( N( ( t self( ( s7 /usr/lib/python2.7/site-packages/leapp/actors/config.pyt sectionL s c C s d S( N( ( R
( ( s7 /usr/lib/python2.7/site-packages/leapp/actors/config.pyt nameP s c C s d S( N( ( R
( ( s7 /usr/lib/python2.7/site-packages/leapp/actors/config.pyt type_T s c C s d S( N( ( R
( ( s7 /usr/lib/python2.7/site-packages/leapp/actors/config.pyt descriptionX s c C s d S( N( ( R
( ( s7 /usr/lib/python2.7/site-packages/leapp/actors/config.pyt default\ s c C s* i i | j d j | j � 6| j 6} | S( s�
Return a dictionary representation of the config item that would be suitable for putting
into a config file.
s {0}_description__( R t formatR R ( t clst representation( ( s7 /usr/lib/python2.7/site-packages/leapp/actors/config.pyt to_dict` s c C sF i | j d 6| j d 6| j d 6| j j � d 6| j d 6| j d 6S( s@
:return: Serialized information for the config
t
class_nameR R t typeR R ( R R R R
t serializeR R ( R ( ( s7 /usr/lib/python2.7/site-packages/leapp/actors/config.pyR q s
(
R R R t abct abstractpropertyR R R
R R t classmethodR R ( ( ( s7 /usr/lib/python2.7/site-packages/leapp/actors/config.pyR ? s c C s_ xX | j � D]J \ } } | | k r2 | | | <q
x"