�
�Udac @` s� d Z d d l m Z m Z m Z e Z d d l m Z d d l m
Z
d d l m Z d d l m
Z
d d l m Z d d l m Z d d l m Z d
e f d � � YZ d S(
s�
The iosxr_lacp class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessary to bring the current configuration to it's desired end-state is
created
i ( t absolute_importt divisiont print_function( t
ConfigBase( t to_list( t Facts( t dict_diff( t iteritems( t remove_empties( t flatten_dictt Lacpc B` s} e Z d Z d d g Z d g Z d � Z d � Z d � Z d � Z d � Z e
d � � Z e
d
� � Z e
d � � Z
RS( s
The iosxr_lacp class
s !alls !mint lacpc C` s t t | � j | � d S( N( t superR
t __init__( t selft module( ( sW /usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyR
+ s c C` sH t | j � j | j | j � \ } } | d j d � } | sD i S| S( s� Get the 'facts' (the current configuration)
:rtype: A dictionary
:returns: The current configuration as a dictionary
t ansible_network_resourcesR ( R t _modulet get_factst
gather_subsett gather_network_resourcest get( R t factst _warningst
lacp_facts( ( sW /usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyt get_lacp_facts. s
'c C` s� i t d 6} t � } t � } | j � } | j | j | � � | rs | j j sf | j j | � n t | d <n | | d <| j � } | | d <| d r� | | d <n | | d <| S( sm Execute the module
:rtype: A dictionary
:returns: The result from module execution
t changedt commandst beforet aftert warnings(
t Falset listR t extendt
set_configR t
check_modet _connectiont edit_configt True( R t resultR R t existing_lacp_factst changed_lacp_facts( ( sW /usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyt execute_module: s
c C` sF | j j j d � } | s$ i } n | } | j | | � } t | � S( s! Collect the configuration from the args passed to the module,
collect the current configuration (as a dict from facts)
:rtype: A list
:returns: the commands necessary to migrate the current configuration
to the desired configuration
t config( R t paramsR t set_stateR ( R R( t wantt havet resp( ( sW /usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyR"