Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/storage/glusterfs/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/storage/glusterfs/_gluster_heal_facts.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddlmZdad�Zd�Zd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: gluster_heal_info
short_description: Gather information on self-heal or rebalance status
author: "Devyani Kota (@devyanikota)"
version_added: "2.8"
description:
  - Gather facts about either self-heal or rebalance status.
  - This module was called C(gluster_heal_facts) before Ansible 2.9, returning C(ansible_facts).
    Note that the M(gluster_heal_info) module no longer returns C(ansible_facts)!
options:
  name:
    description:
      - The volume name.
    required: true
    aliases: ['volume']
  status_filter:
    default: "self-heal"
    choices: ["self-heal", "rebalance"]
    description:
      - Determines which facts are to be returned.
      - If the C(status_filter) is C(self-heal), status of self-heal, along with the number of files still in process are returned.
      - If the C(status_filter) is C(rebalance), rebalance status is returned.
requirements:
  - GlusterFS > 3.2
s�
- name: Gather self-heal facts about all gluster hosts in the cluster
  gluster_heal_info:
    name: test_volume
    status_filter: self-heal
  register: self_heal_status
- debug:
    var: self_heal_status

- name: Gather rebalance facts about all gluster hosts in the cluster
  gluster_heal_info:
    name: test_volume
    status_filter: rebalance
  register: rebalance_status
- debug:
    var: rebalance_status
s�
name:
    description: GlusterFS volume name
    returned: always
    type: str
status_filter:
    description: Whether self-heal or rebalance status is to be returned
    returned: always
    type: str
heal_info:
    description: List of files that still need healing process
    returned: On success
    type: list
rebalance_status:
    description: Status of rebalance operation
    returned: On success
    type: list
N(t
AnsibleModule(t	to_native(tLooseVersiontcK`s�tdg}|j|�yftj||�\}}}|dkr~tjdddj|�||pg|fdtj��nWnHtk
r�}tjdddj|�t	|�fdtj��nX|S(Ns
--mode=scriptitmsgs.error running gluster (%s) command (rc=%d): %st t	exceptions&error running gluster (%s) command: %s(
t
glusterbintextendtmoduletrun_commandt	fail_jsontjoint	tracebackt
format_exct	ExceptionR	(tgargstkwargstargstrctoutterrte((sY/usr/lib/python2.7/site-packages/ansible/modules/storage/glusterfs/_gluster_heal_facts.pytrun_glusterXs
3!c
C`stdd|dgdtdddddd��}|jd	�}g}x�|D]�}d
|kr�i}|j�jd
�|d<qOd|kr�|jd
�dj�|d<qOd|kr�|jd
�dj�|d<qO|jd�sOd	|kr�qOqO|o|j|�i}qOW|S(Ntvolumethealtinfotenviron_updatetLANGtCtLC_ALLtLC_MESSAGESs
tBricktbricktStatust:iRtNumbert
no_of_entriest/(Rtdicttsplittstript
startswithtappend(tnameRtraw_outt	heal_infotlinetbr_dict((sY/usr/lib/python2.7/site-packages/ansible/modules/storage/glusterfs/_gluster_heal_facts.pytget_self_heal_statushs 3
  
c
C`sctdd|dgdtdddddd��}|jd	�}g}x|D]}d
j|j��}|jd
�}|djd�sO|djd
�r�qOni}t|�dksOt|�dkr�qOn|d|d<|d|d<|d|d<d|kr1|d|d|d<|j|�qOd|krO|d|d<|j|�qOqOW|S(NR t	rebalanceRR#R$R%R&R's
R
it-tNodeiitnodetrebalanced_filestfailuressin progressiit	completed(RR/R0RR2tlenR3(R4RR5trebalance_statusR7t	line_valst	node_dict((sY/usr/lib/python2.7/site-packages/ansible/modules/storage/glusterfs/_gluster_heal_facts.pytget_rebalance_status}s*3
&$cC`se|jdt�d}|j|�}|djd�d}|jd�d}t|�t|�kS(Ntglusters
 --versionis
iR
(tget_bin_pathtTrueRR0R
(Rtrequired_versiontcmdtresulttver_linetversion((sY/usr/lib/python2.7/site-packages/ansible/modules/storage/glusterfs/_gluster_heal_facts.pytis_invalid_gluster_version�s
cC`s�tdtdtdddtddg�dtddd	d
dd
dg���atjd
k}|r|tjddd�ntjdt�ad}tjd}tjd}d}d}t	t|�r�tj
dd|�ny:|d
kr�t|�}n|dkrt|�}nWn3t
k
rO}tj
dd|dtj��nXi}i|d6|d6|d6|d6|d<|r�tjd|�n
tj|�dS(Nt
argument_specR4ttypetstrtrequiredtaliasesR t
status_filtertdefaults	self-healtchoicesR:tgluster_heal_factss|The 'gluster_heal_facts' module has been renamed to 'gluster_heal_info', and the renamed one no longer returns ansible_factsRMs2.13RFs3.2RRs"GlusterFS version > %s is requiredsError retrieving status: %sRR6t	glusterfst
ansible_facts(RR/RHRt_namet	deprecateRGRtparamsRNRR9RERRRt	exit_json(tis_old_factsRIRTtvolume_nameR6RBRtfacts((sY/usr/lib/python2.7/site-packages/ansible/modules/storage/glusterfs/_gluster_heal_facts.pytmain�s:'


$&t__main__(t
__future__RRRRPt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRtansible.module_utils.basicRtansible.module_utils._textR	tdistutils.versionR
RRR9RERNRat__name__(((sY/usr/lib/python2.7/site-packages/ansible/modules/storage/glusterfs/_gluster_heal_facts.pyt<module>s&


				
	+

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]