Bug 1209015
| Summary: | Accessing the enabled_tcp_inbound_ports virtual column of a MiqAeServiceHostRedhat gives a <NoMethodError>: <undefined method `find_all_by_enabled_and_protocol_and_direction' for [ ]:ActiveRecord::Relation> | ||
|---|---|---|---|
| Product: | Red Hat CloudForms Management Engine | Reporter: | Peter McGowan <pmcgowan> |
| Component: | Automate | Assignee: | mkanoor |
| Status: | CLOSED ERRATA | QA Contact: | Dave Johnson <dajohnso> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 5.3.0 | CC: | jhardy, mkanoor, obarenbo, psavage, tfitzger |
| Target Milestone: | GA | ||
| Target Release: | 5.4.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-06-16 12:56:52 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Migration 20140214191729_enhance_firewall_rules_for_neutron_networking.rb renamed the protocol column to host_protocol. The get_ports method in the host.rb file needs to be updated to use the new column name. New commit detected on manageiq/master: https://github.com/ManageIQ/manageiq/commit/c3e0af2e291e001bc5590eb09440ad8510076efd commit c3e0af2e291e001bc5590eb09440ad8510076efd Author: Madhu Kanoor <mkanoor> AuthorDate: Mon Apr 6 14:16:56 2015 -0400 Commit: Madhu Kanoor <mkanoor> CommitDate: Tue Apr 7 12:28:05 2015 -0400 Fixed the function name to include _host Added a spec and fixed the function name https://bugzilla.redhat.com/show_bug.cgi?id=1209015 vmdb/app/models/host.rb | 6 +++--- vmdb/spec/models/host_spec.rb | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) Verified in 5.4.0.0.22.20150420163946 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2015-1100.html |
Description of problem: A MiqAeServiceHostRedhat object has four virtual columns: enabled_tcp_inbound_ports enabled_tcp_outbound_ports enabled_udp_inbound_ports enabled_udp_outbound_ports however when any of these is accessed an exception is raised: <NoMethodError>: <undefined method `find_all_by_enabled_and_protocol_and_direction' for [ ]:ActiveRecord::Relation> Each of these methods calls self.get_ports, which contains the code: def get_ports(*args) return [] if self.operating_system.nil? if args.length == 3 rules = self.operating_system.firewall_rules.find_all_by_enabled_and_protocol_and_direction(*args) ...however the firewall_rules table doesn't seem to have a 'protocol' column: vmdb_production=# \d firewall_rules Table "public.firewall_rules" Column | Type | Modifiers --------------------------+-----------------------------+------------------------------------------------------------- id | bigint | not null default nextval('firewall_rules_id_seq'::regclass) name | character varying(255) | display_name | character varying(255) | group | character varying(255) | enabled | boolean | required | boolean | host_protocol | character varying(255) | direction | character varying(255) | port | integer | end_port | integer | created_on | timestamp without time zone | updated_on | timestamp without time zone | resource_id | bigint | resource_type | character varying(255) | source_security_group_id | bigint | source_ip_range | character varying(255) | ems_ref | character varying(255) | network_protocol | character varying(255) | Indexes: "firewall_rules_pkey" PRIMARY KEY, btree (id) "index_firewall_rules_on_resource_id_and_resource_type" btree (resource_id, resource_type) Version-Release number of selected component (if applicable): 5.3.3 How reproducible: Every time Additional info: