hammer_cli_foreman_remote_execution 0.3.4 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 767606c49435cc7b2d77f94795e383d4e3d7684be4ed5d2e906cc754baa98243
4
- data.tar.gz: e38f2db0734bddeca92dccdaaad187b22bb8bd8afbec4b16d06a1496ff9d7a8f
3
+ metadata.gz: 728c575df08eaa7700ff80da947324200ddcf3d30472e8169659371024f43295
4
+ data.tar.gz: e32c8cb6341618664b69e2f442f811d83fd91b599091af49f9bcbbf800121cd0
5
5
  SHA512:
6
- metadata.gz: 9cedfd16a5bebfde884af49a8a3542ffca71c9dfb0388ba8b0b1d2c45d6b4db7c0273755b164b18a31efca3f1f8ecaf7c69b7ba6dac9f9aba296f58985f63a67
7
- data.tar.gz: d694847dd49a9ac002e483721c30fb7010e60180bb812dbfe97e4bebbf6f2dcd9e1f30e221ae38218a6cf57186770fc1c60bbc9ae389f28f1b05f5168988d7d6
6
+ metadata.gz: 7e674f549716085bb6fee409a93d42e391fbcadd0e162f3369200b75fdf381883ec7e7a089289831d7b82547cd1e1789c6e18c15dbc9c9de98cd724d626cd603
7
+ data.tar.gz: f1648d88367a4aabc09eb132bd36a2082c6bf840af09646037908e0cbc881b9e70677116d999f8b34dcf2c031850168157c0f985c391664f86d00a308bc36084
@@ -25,6 +25,7 @@ module HammerCLIForemanRemoteExecution
25
25
  field :description, _('Description'), Fields::Text
26
26
  field :cloned_from_id, _("Cloned from id"), nil, :hide_blank => true
27
27
  field :template_inputs, _('Inputs')
28
+ field :locked, _('Locked')
28
29
  HammerCLIForeman::References.taxonomies(self)
29
30
  end
30
31
 
@@ -59,6 +60,28 @@ module HammerCLIForemanRemoteExecution
59
60
  end
60
61
  end
61
62
 
63
+ class CloneCommand < HammerCLIForeman::CreateCommand
64
+ command_name 'clone'
65
+ action :clone
66
+ desc _('Clone a job template')
67
+
68
+ option '--new-name', 'NEW_NAME', N_('Name for the cloned template'),
69
+ :attribute_name => :option_new_name, :required => true
70
+
71
+ success_message _('Job template cloned')
72
+ failure_message _('Could not clone the job template')
73
+
74
+ def request_params
75
+ params = super
76
+ params['job_template']['name'] = option_new_name
77
+ params
78
+ end
79
+
80
+ build_options do |o|
81
+ o.without(:name)
82
+ end
83
+ end
84
+
62
85
  class ImportCommand < HammerCLIForeman::CreateCommand
63
86
  command_name 'import'
64
87
  action :import
@@ -2,6 +2,6 @@
2
2
 
3
3
  module HammerCLIForemanRemoteExecution
4
4
  def self.version
5
- @version ||= Gem::Version.new '0.3.4'
5
+ @version ||= Gem::Version.new '0.4.1'
6
6
  end
7
7
  end
@@ -38,7 +38,7 @@ describe HammerCLIForemanRemoteExecution::JobTemplate do
38
38
 
39
39
  describe 'output' do
40
40
  with_params ['--id=1'] do
41
- it_should_print_columns ['ID', 'Name', 'Job Category', 'Provider', 'Type']
41
+ it_should_print_columns ['ID', 'Name', 'Job Category', 'Provider', 'Type', 'Locked']
42
42
  end
43
43
  end
44
44
  end
@@ -108,4 +108,13 @@ describe HammerCLIForemanRemoteExecution::JobTemplate do
108
108
  '--provider-type=SSH']
109
109
  end
110
110
  end
111
+
112
+ describe 'CloneCommand' do
113
+ let(:cmd) { HammerCLIForemanRemoteExecution::JobTemplate::CloneCommand.new('', ctx) }
114
+
115
+ describe 'parameters' do
116
+ it_should_accept 'id and new-name', ['--id=1', '--new-name=Cloned Template']
117
+ it_should_accept 'name and new-name', ['--name=Parent Template', '--new-name=Cloned Template']
118
+ end
119
+ end
111
120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman_remote_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Remote Execution team
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  - !ruby/object:Gem::Version
129
129
  version: '0'
130
130
  requirements: []
131
- rubygems_version: 3.6.9
131
+ rubygems_version: 4.0.3
132
132
  specification_version: 4
133
133
  summary: CLI for the Foreman remote execution plugin
134
134
  test_files: