def list_zones(verbose=True, installed=False, configured=False, hide_global=True):
 zones = {}
 header = 'zoneid:zonename:state:zonepath:uuid:brand:ip-type'.split(':')
 zone_data = __salt__['cmd.run_all']('zoneadm list -p -c')
 if (zone_data['retcode'] == 0):
  for zone in zone_data['stdout'].splitlines():
   zone = zone.split(':')
   zone_t = {}
   for i in range(0, len(header)):
    zone_t[header[i]] = zone[i]
   if (hide_global and (zone_t['zonename'] == 'global')):
    continue
   if ((not installed) and (zone_t['state'] == 'installed')):
    continue
   if ((not configured) and (zone_t['state'] == 'configured')):
    continue
   zones[zone_t['zonename']] = zone_t
   del zones[zone_t['zonename']]['zonename']
 return (zones if verbose else sorted(zones.keys()))

def list_zones ( verbose = True , installed = False , configured = False , hide_global = True ) : zones = { } header = 'zoneid:zonename:state:zonepath:uuid:brand:ip-type' . split ( ':' ) zone_data = __salt__ [ 'cmd.run_all' ] ( 'zoneadm list -p -c' ) if ( zone_data [ 'retcode' ] == 0 ) : for zone in zone_data [ 'stdout' ] . splitlines ( ) : zone = zone . split ( ':' ) zone_t = { } for i in range ( 0 , len ( header ) ) : zone_t [ header [ i ] ] = zone [ i ] if ( hide_global and ( zone_t [ 'zonename' ] == 'global' ) ) : continue if ( ( not installed ) and ( zone_t [ 'state' ] == 'installed' ) ) : continue if ( ( not configured ) and ( zone_t [ 'state' ] == 'configured' ) ) : continue zones [ zone_t [ 'zonename' ] ] = zone_t del zones [ zone_t [ 'zonename' ] ] [ 'zonename' ] return ( zones if verbose else sorted ( zones . keys ( ) ) )
list zones for the given profile .