Skip to content

Commit

Permalink
Merge pull request #21674 from kbrock/supports_manager_create
Browse files Browse the repository at this point in the history
add supports :create for scripts
  • Loading branch information
agrare committed Feb 1, 2022
2 parents c0f8a69 + 5a1b57e commit 2d1d489
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/authentication.rb
Expand Up @@ -2,7 +2,7 @@ class Authentication < ApplicationRecord
acts_as_miq_taggable
include_concern 'ImportExport'
include YAMLImportExportMixin

include SupportsFeatureMixin
include NewWithTypeStiMixin
def self.new(*args, &block)
if self == Authentication && (args.empty? || args.first.kind_of?(Hash))
Expand Down
1 change: 1 addition & 0 deletions app/models/configuration_script_base.rb
Expand Up @@ -22,4 +22,5 @@ class ConfigurationScriptBase < ApplicationRecord
scope :with_manager, ->(manager_id) { where(:manager_id => manager_id) }

include ProviderObjectMixin
include SupportsFeatureMixin
end
2 changes: 2 additions & 0 deletions app/models/configuration_script_source.rb
@@ -1,6 +1,8 @@
class ConfigurationScriptSource < ApplicationRecord
acts_as_miq_taggable

include SupportsFeatureMixin

has_many :configuration_script_payloads, :dependent => :destroy
belongs_to :authentication
belongs_to :manager, :class_name => "ExtManagementSystem"
Expand Down
2 changes: 0 additions & 2 deletions app/models/manageiq/providers/cloud_manager/auth_key_pair.rb
@@ -1,6 +1,4 @@
class ManageIQ::Providers::CloudManager::AuthKeyPair < ::Authentication
include SupportsFeatureMixin

acts_as_miq_taggable
has_and_belongs_to_many :vms, :join_table => :key_pairs_vms, :foreign_key => :authentication_id

Expand Down
Expand Up @@ -7,6 +7,8 @@ class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScri
validates :scm_type, :presence => true, :inclusion => { :in => %w[git] }
validates :scm_branch, :presence => true

supports :create

default_value_for :scm_type, "git"
default_value_for :scm_branch, "master"

Expand Down
Expand Up @@ -8,6 +8,8 @@ class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Credential < Mana

after_create :set_manager_ref

supports :create

COMMON_ATTRIBUTES = {}.freeze
EXTRA_ATTRIBUTES = {}.freeze
API_ATTRIBUTES = COMMON_ATTRIBUTES.merge(EXTRA_ATTRIBUTES).freeze
Expand Down

0 comments on commit 2d1d489

Please sign in to comment.