o
    idb                     @   s,   d dl mZ d dlmZ G dd deZdS )    quote)Clusterc                   @   s0   e Zd ZdZdZdZdd Zdd Zdd	 Zd
S )	satellitea3  
    This profile is specifically for Red Hat Satellite 6, and not earlier
    releases of Satellite.

    While note technically a 'cluster' in the traditional sense, Satellite
    does provide for 'capsule' nodes which is what this profile aims to
    enumerate beyond the 'primary' Satellite system.
    zRed Hat Satellite 6)r   zsatellite-installerc                 C   s   d}d}|t |t |  S )Nzsu postgres -c %szpsql foreman -c %sr   )selfquery_cmd_dbcmd r
   B/usr/lib/python3/dist-packages/sos/collector/clusters/satellite.py	_psql_cmd   s   zsatellite._psql_cmdc                 C   sB   |  d}| j|dd}|d dkrdd |d  D }|S g S )	Nz/copy (select name from smart_proxies) to stdoutT)	need_rootstatusr   c                 S   s   g | ]
}d |vr|  qS )zcould not change directory)strip).0nr
   r
   r   
<listcomp>%   s
    z'satellite.get_nodes.<locals>.<listcomp>output)r   exec_primary_cmd
splitlines)r   cmdresnodesr
   r
   r   	get_nodes!   s   

zsatellite.get_nodesc                 C   s   |j | jj kr	dS dS )Nr   capsule)addressprimary)r   noder
   r
   r   set_node_label,   s   zsatellite.set_node_labelN)	__name__
__module____qualname____doc__cluster_namepackagesr   r   r   r
   r
   r
   r   r      s    	r   N)pipesr   sos.collector.clustersr   r   r
   r
   r
   r   <module>   s   
