hammer_cli_foreman_remote_execution 0.3.4 → 0.4.0

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: 420ed2ef07e5be66a18b1e2e504e4b9c226ef9513332315574d6fcca3c13ae7f
4
+ data.tar.gz: 4bc010f9e9e0acb8a0b6ca0377e4baaa2bd05a970a8efadf40f5b7abab660f02
5
5
  SHA512:
6
- metadata.gz: 9cedfd16a5bebfde884af49a8a3542ffca71c9dfb0388ba8b0b1d2c45d6b4db7c0273755b164b18a31efca3f1f8ecaf7c69b7ba6dac9f9aba296f58985f63a67
7
- data.tar.gz: d694847dd49a9ac002e483721c30fb7010e60180bb812dbfe97e4bebbf6f2dcd9e1f30e221ae38218a6cf57186770fc1c60bbc9ae389f28f1b05f5168988d7d6
6
+ metadata.gz: 278b99088d60ca4de83042abdfde5d9523981fa94e3dd0aac7955a4ceff70bbcef06b10b316d76997db89b9f8894cb93fc16930b21679b1fee1e91852add863f
7
+ data.tar.gz: 2186ba3924b47a4db361fd257f6042de0ff79fac0bb6c528cd218611e663af33c1b2cb5125d2b39abf78f0ec69131b1c5297de05a4706f75dd398842facadd45
@@ -59,6 +59,28 @@ module HammerCLIForemanRemoteExecution
59
59
  end
60
60
  end
61
61
 
62
+ class CloneCommand < HammerCLIForeman::CreateCommand
63
+ command_name 'clone'
64
+ action :clone
65
+ desc _('Clone a job template')
66
+
67
+ option '--new-name', 'NEW_NAME', N_('Name for the cloned template'),
68
+ :attribute_name => :option_new_name, :required => true
69
+
70
+ success_message _('Job template cloned')
71
+ failure_message _('Could not clone the job template')
72
+
73
+ def request_params
74
+ params = super
75
+ params['job_template']['name'] = option_new_name
76
+ params
77
+ end
78
+
79
+ build_options do |o|
80
+ o.without(:name)
81
+ end
82
+ end
83
+
62
84
  class ImportCommand < HammerCLIForeman::CreateCommand
63
85
  command_name 'import'
64
86
  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.0'
6
6
  end
7
7
  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.0
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: