internal static void DoAutoRunProfileDiscovery(MAControllerConfiguration config, ManagementAgent ma)
 {
     foreach (PartitionConfiguration p in config.Partitions)
     {
         MAConfigDiscovery.DoAutoRunProfileDiscovery(p, ma);
     }
 }
Пример #2
0
        internal void ResolvePartitions(ManagementAgent ma)
        {
            if (this.Partitions == null)
            {
                this.Partitions = new PartitionConfigurationCollection();
            }

            foreach (PartitionConfiguration c in this.Partitions)
            {
                bool found = false;

                foreach (Partition p in ma.Partitions.Values.Where(t => t.Selected))
                {
                    if (c.ID == p.ID || string.Equals(c.Name, p.Name, StringComparison.OrdinalIgnoreCase))
                    {
                        c.UpdateConfiguration(p);
                        found = true;
                        break;
                    }
                }

                if (!found)
                {
                    c.IsMissing = true;
                }
            }

            foreach (Partition p in ma.Partitions.Values.Where(t => t.Selected && this.Partitions.GetItemOrNull(t.ID) == null))
            {
                PartitionConfiguration c = new PartitionConfiguration(p);
                MAConfigDiscovery.DoAutoRunProfileDiscovery(c, ma);
                this.Partitions.Add(c);
            }
        }
Пример #3
0
        internal void ResolvePartitions(ManagementAgent ma)
        {
            if (this.Partitions == null)
            {
                this.Partitions = new PartitionConfigurationCollection();
            }

            foreach (PartitionConfiguration c in this.Partitions)
            {
                bool found = false;

                foreach (Partition p in ma.Partitions.Values.Where(t => t.Selected))
                {
                    if (c.ID == p.ID || string.Equals(c.Name, p.Name, StringComparison.OrdinalIgnoreCase))
                    {
                        logger.Trace($"Matched existing partition {c.ID}/{p.ID}/{c.Name}/{p.Name}");
                        c.UpdateConfiguration(p);
                        found = true;
                        break;
                    }
                }

                if (!found)
                {
                    logger.Trace($"Partition is missing from MA {c.ID}/{c.Name}");
                    c.IsMissing = true;
                }
            }

            foreach (Partition p in ma.Partitions.Values.Where(t => t.Selected && this.Partitions.GetItemOrNull(t.ID) == null))
            {
                logger.Trace($"New partition found in MA {p.ID}/{p.Name}");
                PartitionConfiguration c = new PartitionConfiguration(p);
                MAConfigDiscovery.DoAutoRunProfileDiscovery(c, ma);
                this.Partitions.Add(c);
            }

            logger.Trace($"{this.Partitions.Count} partitions are defined for the controller");
        }