Skip to content

Commit 85e2f08

Browse files
committed
Drop Log Collection Backend 2
Follow up to ManageIQ#23647. This drops the FileDepot#miq_schedules linkage, and also drops FileDepotFtp and FileDepotFtpAnonymous, since the only user of FileDepot stuff, PxeServer, doesn't support Ftp. By extension this also drops the net-ftp gem.
1 parent 1288a73 commit 85e2f08

17 files changed

+2
-158
lines changed

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ gem "manageiq-ssh-util", "~>0.2.0", :require => false
5656
gem "memoist", "~>0.16.0", :require => false
5757
gem "money", "~>6.13.5", :require => false
5858
gem "more_core_extensions" # min version should be set in manageiq-gems-pending, not here
59-
gem "net-ftp", "~>0.1.2", :require => false
6059
gem "net-ldap", "~>0.16.1", :require => false
6160
gem "net-ping", "~>1.7.4", :require => false
6261
gem "openscap", "~>0.4.8", :require => false

app/models/file_depot.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ class FileDepot < ApplicationRecord
44
include ImportExport
55
include YamlImportExportMixin
66

7-
has_many :miq_schedules, :dependent => :nullify
8-
97
validates_presence_of :uri
108

119
def self.supported_depots

app/models/file_depot_ftp.rb

Lines changed: 0 additions & 66 deletions
This file was deleted.

app/models/file_depot_ftp_anonymous.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

app/models/miq_schedule.rb

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class MiqSchedule < ApplicationRecord
1616
virtual_column :v_zone_name, :type => :string, :uses => :zone
1717
virtual_column :next_run_on, :type => :datetime
1818

19-
belongs_to :file_depot
2019
belongs_to :miq_search
2120
belongs_to :resource, :polymorphic => true
2221
belongs_to :zone
@@ -302,26 +301,6 @@ def validate_run_at
302301
end
303302
end
304303

305-
def verify_file_depot(params) # TODO: This logic belongs in the UI, not sure where
306-
depot_class = FileDepot.supported_protocols[params[:uri_prefix]]
307-
depot = file_depot.class.name == depot_class ? file_depot : build_file_depot(:type => depot_class)
308-
depot.name = params[:name]
309-
uri = params[:uri]
310-
api_port = params[:swift_api_port]
311-
depot.aws_region = params[:aws_region]
312-
depot.openstack_region = params[:openstack_region]
313-
depot.keystone_api_version = params[:keystone_api_version]
314-
depot.v3_domain_ident = params[:v3_domain_ident]
315-
depot.security_protocol = params[:security_protocol]
316-
depot.uri = api_port.blank? ? uri : depot.merged_uri(URI(uri), api_port)
317-
if params[:save]
318-
file_depot.save!
319-
file_depot.update_authentication(:default => {:userid => params[:username], :password => params[:password]}) if (params[:username] || params[:password]) && depot.class.requires_credentials?
320-
elsif depot.class.requires_credentials?
321-
depot.verify_credentials(nil, params)
322-
end
323-
end
324-
325304
def next_interval_time
326305
unless valid? || errors[:run_at].blank?
327306
_log.warn("Invalid schedule [#{id}] [#{name}]: #{Array.wrap(errors[:run_at]).join(", ")}")

app/models/miq_schedule/import_export.rb

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ def handle_attributes(export_attributes)
1919

2020
export_attributes['MiqSearchContent'] = MiqSearch.find_by(:id => export_attributes['miq_search_id']).export_to_array if export_attributes['miq_search_id']
2121

22-
export_attributes['FileDepotContent'] = FileDepot.find_by(:id => export_attributes['file_depot_id']).export_to_array if export_attributes['file_depot_id']
23-
2422
if export_attributes['resource_id']
2523
schedule_resource = export_attributes["resource_type"].safe_constantize.find_by(:id => export_attributes['resource_id'])
2624
export_attributes['resource_name'] = schedule_resource&.name
@@ -71,7 +69,6 @@ def import_from_hash(miq_schedule, options = nil)
7169
filter_resource_name = miq_schedule.delete("filter_resource_name")
7270

7371
miq_search = miq_schedule.delete("MiqSearchContent")
74-
file_depot = miq_schedule.delete("FileDepotContent")
7572
resource_name = miq_schedule.delete("resource_name")
7673

7774
was_new_record = new_or_existing_schedule.new_record?
@@ -95,27 +92,6 @@ def import_from_hash(miq_schedule, options = nil)
9592
schedule_attributes[:miq_search_id] = search.id
9693
end
9794

98-
if file_depot
99-
authentication_content = file_depot[0].values[0].delete("AuthenticationsContent")
100-
fd = FileDepot.where(file_depot[0].values[0]).first_or_create
101-
102-
authentication_content[0].each do |auth|
103-
x = auth.values[0]
104-
x['resource'] = fd
105-
106-
group_description = x.delete('miq_group_description')
107-
miq_group = MiqGroup.find_by(:description => group_description) || User.find_by(:userid=>'admin').current_group
108-
x['miq_group_id'] = miq_group.id
109-
110-
tenant_name = x.delete('tenant_name')
111-
tenant = Tenant.find_by(:name => tenant_name) || Tenant.tenant_root
112-
x['tenant_id'] = tenant.id
113-
114-
Authentication.where(x).first_or_create
115-
end
116-
new_or_existing_schedule.file_depot_id = fd.id
117-
end
118-
11995
if resource_name
12096
schedule_resource = miq_schedule["resource_type"].safe_constantize.find_by(:name => resource_name)
12197
schedule_attributes['resource_id'] = schedule_resource.id if schedule_resource

locale/en.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,8 +1435,6 @@ en:
14351435
EmsFolder: Folder
14361436
ExtManagementSystem: Provider
14371437
ExtManagementSystemPerformance: Performance - Provider
1438-
FileDepotFtp: FTP
1439-
FileDepotFtpAnonymous: Anonymous FTP
14401438
FileDepotNfs: NFS
14411439
FileDepotS3: AWS S3
14421440
FileDepotSwift: OpenStack Swift
@@ -1568,7 +1566,7 @@ en:
15681566
ManageIQ::Providers::Vmware::CloudManager: Cloud Provider (VMware vCloud)
15691567
ManageIQ::Providers::IbmCic::CloudManager: Cloud Provider (IBM CIC)
15701568
ManageIQ::Providers::IbmCloud::VPC::CloudManager: Cloud Provider (IBM Cloud VPC)
1571-
ManageIQ::Providers::AzureStack::CloudManager: Cloud Provider (Microsoft Azure Stack)
1569+
ManageIQ::Providers::AzureStack::CloudManager: Cloud Provider (Microsoft Azure Stack)
15721570
ManageIQ::Providers::IbmCloud::PowerVirtualServers::CloudManager: Cloud Provider (IBM Cloud Power Systems Virtual Servers)
15731571
ManageIQ::Providers::IbmPowerVc::CloudManager: Cloud Provider (IBM PowerVC)
15741572
ManageIQ::Providers::OracleCloud::CloudManager: Cloud Provider (Oracle Cloud)

spec/factories/file_depot.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
uri { "nfs://somehost/export" }
55
end
66

7-
factory(:file_depot_ftp, :class => "FileDepotFtp", :parent => :file_depot) { uri { "ftp://somehost/export" } }
87
factory(:file_depot_swift, :class => "FileDepotSwift", :parent => :file_depot) { uri { "swift://swifthost/swiftbucket" } }
9-
factory :file_depot_ftp_with_authentication, :parent => :file_depot_ftp do
10-
after(:create) { |x| x.authentications << FactoryBot.create(:authentication) }
11-
end
128
factory :file_depot_swift_with_authentication, :parent => :file_depot_swift do
139
after(:create) { |x| x.authentications << FactoryBot.create(:authentication) }
1410
end

spec/lib/task_helpers/imports/data/widgets/Test_Widget.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,4 @@
124124
userid: system
125125
prod_default: system
126126
adhoc:
127-
file_depot_id:
128127
resource_id:

spec/lib/task_helpers/imports/data/widgets/Test_Widget_Import.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,4 @@
123123
userid: system
124124
prod_default: system
125125
adhoc:
126-
file_depot_id:
127126
resource_id:

0 commit comments

Comments
 (0)