Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #8480 - Adds default setting for act key autoattach, BZ 1166889
- Loading branch information
Showing
5 changed files
with
74 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Copyright 2014 Red Hat, Inc. | ||
# | ||
# This software is licensed to you under the GNU General Public | ||
# License as published by the Free Software Foundation; either version | ||
# 2 of the License (GPLv2) or (at your option) any later version. | ||
# There is NO WARRANTY for this software, express or implied, | ||
# including the implied warranties of MERCHANTABILITY, | ||
# NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should | ||
# have received a copy of GPLv2 along with this software; if not, see | ||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | ||
|
||
module Actions | ||
module Candlepin | ||
module ActivationKey | ||
class Update < Candlepin::Abstract | ||
input_format do | ||
param :cp_id | ||
param :release_version | ||
param :service_level | ||
param :auto_attach | ||
end | ||
|
||
def plan(_activation_key) | ||
::Katello::Resources::Candlepin::ActivationKey.update( | ||
input[:cp_id], | ||
input[:release_version], | ||
input[:service_level], | ||
input[:auto_attach]) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Copyright 2014 Red Hat, Inc. | ||
# | ||
# This software is licensed to you under the GNU General Public | ||
# License as published by the Free Software Foundation; either version | ||
# 2 of the License (GPLv2) or (at your option) any later version. | ||
# There is NO WARRANTY for this software, express or implied, | ||
# including the implied warranties of MERCHANTABILITY, | ||
# NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should | ||
# have received a copy of GPLv2 along with this software; if not, see | ||
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. | ||
|
||
module Actions | ||
module Katello | ||
module ActivationKey | ||
class Update < Actions::EntryAction | ||
def plan(activation_key, activation_key_params) | ||
activation_key.disable_auto_reindex! | ||
activation_key.update_attributes!(activation_key_params) | ||
plan_action(::Actions::Candlepin::ActivationKey::Update, | ||
cp_id: "activation_key.cp_id", | ||
release_version: "activation_key.releaseVer", | ||
service_level: "activation_key.serviceLevel", | ||
auto_attach: "activation_key.autoAttach") | ||
action_subject activation_key | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
db/migrate/20141204203609_add_default_value_to_auto_attach.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class AddDefaultValueToAutoAttach < ActiveRecord::Migration | ||
def up | ||
change_column :katello_activation_keys, :auto_attach, :boolean, :default => true | ||
end | ||
|
||
def down | ||
change_column :katello_activation_keys, :auto_attach, :boolean, :default => nil | ||
end | ||
end |