<commit_before>module ManageIQ::Providers
  class NetworkManager < BaseManager
    class << model_name
      define_method(:route_key) { "ems_networks" }
      define_method(:singular_route_key) { "ems_network" }
    end

    # cloud_subnets are defined on base class, because of virtual_total performance
    has_many :floating_ips,                :foreign_key => :ems_id, :dependent => :destroy
    has_many :security_groups,             :foreign_key => :ems_id, :dependent => :destroy
    has_many :cloud_networks,              :foreign_key => :ems_id, :dependent => :destroy
    has_many :network_ports,               :foreign_key => :ems_id, :dependent => :destroy
    has_many :cloud_subnet_network_ports,  :through => :network_ports
    has_many :network_routers,             :foreign_key => :ems_id, :dependent => :destroy
    has_many :network_groups,              :foreign_key => :ems_id, :dependent => :destroy
    has_many :load_balancers,              :foreign_key => :ems_id, :dependent => :destroy
    has_many :load_balancer_pools,         :foreign_key => :ems_id, :dependent => :destroy
    has_many :load_balancer_pool_members,  :foreign_key => :ems_id, :dependent => :destroy
    has_many :load_balancer_listeners,     :foreign_key => :ems_id, :dependent => :destroy
    has_many :load_balancer_health_checks, :foreign_key => :ems_id, :dependent => :destroy

    alias all_cloud_networks cloud_networks

    belongs_to :parent_manager,
               :foreign_key => :parent_ems_id,
               :class_name  => "ManageIQ::Providers::BaseManager",
               :autosave    => true

    # Relationships delegated to parent manager
    delegate :availability_zones,
             :cloud_tenants,
             :flavors,
             :cloud_resource_quotas,
             :cloud_volumes,
             :cloud_volume_snapshots,
             :cloud_object_store_containers,
             :cloud_object_store_objects,
             :key_pairs,
             :orchestration_stacks,
             :orchestration_stacks_resources,
             :direct_orchestration_stacks,
             :resource_groups,
             :vms,
             :total_vms,
             :hosts,
             :to        => :parent_manager,
             :allow_nil => true
  end<commit_msg>Add missing relations to a NetworkManager<commit_after>module ManageIQ::Providers
  class NetworkManager < BaseManager
    class << model_name
      define_method(:route_key) { "ems_networks" }
      define_method(:singular_route_key) { "ems_network" }
    end

    # cloud_subnets are defined on base class, because of virtual_total performance
    has_many :floating_ips,                    :foreign_key => :ems_id, :dependent => :destroy
    has_many :security_groups,                 :foreign_key => :ems_id, :dependent => :destroy
    has_many :firewall_rules,                  :through => :security_groups
    has_many :cloud_networks,                  :foreign_key => :ems_id, :dependent => :destroy
    has_many :network_ports,                   :foreign_key => :ems_id, :dependent => :destroy
    has_many :cloud_subnet_network_ports,      :through => :network_ports
    has_many :network_routers,                 :foreign_key => :ems_id, :dependent => :destroy
    has_many :network_groups,                  :foreign_key => :ems_id, :dependent => :destroy
    has_many :load_balancers,                  :foreign_key => :ems_id, :dependent => :destroy
    has_many :load_balancer_pools,             :foreign_key => :ems_id, :dependent => :destroy
    has_many :load_balancer_pool_member_pools, :through => :load_balancer_pools
    has_many :load_balancer_pool_members,      :foreign_key => :ems_id, :dependent => :destroy
    has_many :load_balancer_listeners,         :foreign_key => :ems_id, :dependent => :destroy
    has_many :load_balancer_health_checks,     :foreign_key => :ems_id, :dependent => :destroy

    alias all_cloud_networks cloud_networks

    belongs_to :parent_manager,
               :foreign_key => :parent_ems_id,
               :class_name  => "ManageIQ::Providers::BaseManager",
               :autosave    => true

    # Relationships delegated to parent manager
    delegate :availability_zones,
             :cloud_tenants,
             :flavors,
             :cloud_resource_quotas,
             :cloud_volumes,
             :cloud_volume_snapshots,
             :cloud_object_store_containers,
             :cloud_object_store_objects,
             :key_pairs,
             :orchestration_stacks,
             :orchestration_stacks_resources,
             :direct_orchestration_stacks,
             :resource_groups,
             :vms,
             :total_vms,
             :hosts,
             :to        => :parent_manager,
             :allow_nil => true
  end
{'fraction_non_alphanumeric': 0.09136630343671416, 'fraction_numerical': 0.0, 'mean_word_length': 2.466230936819172, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '521935', 'n_tokens_mistral': 1431, 'n_tokens_neox': 1381, 'n_words': 272}