From ff63ba1a2182d1064103936f8472bc4b0869e29c Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Wed, 7 Nov 2018 14:27:57 -0500 Subject: [PATCH] MiqServer.seed should not call Zone.seed --- app/models/miq_server.rb | 1 - spec/models/miq_server_spec.rb | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/miq_server.rb b/app/models/miq_server.rb index af2296a6b49..2407b513043 100644 --- a/app/models/miq_server.rb +++ b/app/models/miq_server.rb @@ -154,7 +154,6 @@ def start def self.seed unless exists?(:guid => my_guid) - Zone.seed _log.info("Creating Default MiqServer with guid=[#{my_guid}], zone=[#{Zone.default_zone.name}]") create!(:guid => my_guid, :zone => Zone.default_zone) my_server_clear_cache diff --git a/spec/models/miq_server_spec.rb b/spec/models/miq_server_spec.rb index b18ffe04972..c63d0d3383c 100644 --- a/spec/models/miq_server_spec.rb +++ b/spec/models/miq_server_spec.rb @@ -1,5 +1,8 @@ describe MiqServer do - include_examples ".seed called multiple times" + context ".seed" do + before { Zone.seed } + include_examples ".seed called multiple times" + end context "#hostname" do it("with a valid hostname") { expect(MiqServer.new(:hostname => "test").hostname).to eq("test") }