
    
                     >   d 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dlmZ d	Z G d
 de      Z ej$                  ej&                  j(                  ej&                  j*                         G d dej,                  ej.                               Zy)z]The command to get the version of all memberships with the Config Management Feature enabled.    )absolute_import)division)unicode_literals)util)base)api_util)logNAc                       e Zd ZdZd Zy)ConfigmanagementFeatureStatez&Feature state class stores ACM status.c                 (    || _         t        | _        y )N)namer
   version)selfcluster_names     8lib/surface/container/fleet/config_management/version.py__init__z%ConfigmanagementFeatureState.__init__"   s    DIDL    N)__name__
__module____qualname____doc__r    r   r   r   r      s
    .r   r   c                   *    e Zd ZdZdZed        Zd Zy)VersionzPrint the version of all clusters with Config Management enabled.

  ## EXAMPLES

  To print the version of all clusters with Config Management enabled, run:

    $ {command}
  configmanagementc                 :    | j                   j                  d       y )Nz3table(name:label=Name:sort=1,version:label=Version))display_info	AddFormat)parsers    r   ArgszVersion.Args4   s    
!!=r   c                    t        j                         \  }}|r$t        j                  dj	                  |             | j                         }g }| j                  j                  |j                        j                         D ci c]  \  }}t        j                  |      | }}}|D ]  }	t        j                  |	      }	t        |	      }
|	|vr|j                  |
       9||	   }|j                  }|r=|j                  r1|j                  j                   r|j                  j                   |
_        |j                  |
        |S c c}}w )NzILocations {} are currently unreachable. Version entries may be incomplete)r   ListMembershipsFullr	   warningformat
GetFeature	hubclientToPyDictmembershipStatesitemsr   MembershipPartialNamer   appendr   membershipSpecr   )r   argsmembershipsunreachablef
acm_statusmsfeature_state_membershipsr   clustermdfss                r   RunzVersion.Run:   s6   ';;=K	kk&&,f[&9 	AJ NN++A,>,>?EEG!GDAq 	""1%q(G  ! ''-d,T2g	.	.'"$T*bb	!!b&7&7&?&?++33   !!s    E	N)r   r   r   r   feature_namestaticmethodr!   r9   r   r   r   r   r   '   s%     $, 
r   r   N)r   
__future__r   r   r   &googlecloudsdk.api_lib.container.fleetr   googlecloudsdk.callioper   *googlecloudsdk.command_lib.container.fleetr   3googlecloudsdk.command_lib.container.fleet.featuresfeature_basegooglecloudsdk.corer	   r
   objectr   ReleaseTracksReleaseTrackALPHABETAFeatureCommandListCommandr   r   r   r   <module>rJ      s    d &  ' 7 ( ? T # 
6  D%%++T->->-C-CD-l))4+;+; - E-r   