hammer_cli_foreman_remote_execution 0.2.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci_test.yml +22 -0
- data/.rubocop.yml +7 -4
- data/.rubocop_todo.yml +81 -0
- data/.tx/config +5 -4
- data/Gemfile +10 -9
- data/Rakefile +9 -25
- data/hammer_cli_foreman_remote_execution.gemspec +6 -2
- data/lib/hammer_cli_foreman_remote_execution/foreign_input_set.rb +2 -0
- data/lib/hammer_cli_foreman_remote_execution/i18n.rb +5 -7
- data/lib/hammer_cli_foreman_remote_execution/interface_extensions.rb +2 -2
- data/lib/hammer_cli_foreman_remote_execution/job_invocation.rb +6 -4
- data/lib/hammer_cli_foreman_remote_execution/job_template.rb +8 -6
- data/lib/hammer_cli_foreman_remote_execution/options/normalizers.rb +5 -3
- data/lib/hammer_cli_foreman_remote_execution/remote_execution_feature.rb +4 -1
- data/lib/hammer_cli_foreman_remote_execution/subnet_extensions.rb +3 -1
- data/lib/hammer_cli_foreman_remote_execution/template_input.rb +2 -0
- data/lib/hammer_cli_foreman_remote_execution/version.rb +3 -1
- data/lib/hammer_cli_foreman_remote_execution.rb +2 -0
- data/locale/Makefile +2 -53
- data/locale/ca/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/ca/hammer_cli_foreman_remote_execution.po +311 -0
- data/locale/cs_CZ/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/{de/hammer-cli-foreman-remote-execution.po → cs_CZ/hammer_cli_foreman_remote_execution.po} +104 -67
- data/locale/de/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/de/hammer_cli_foreman_remote_execution.po +311 -0
- data/locale/en/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/en/{hammer-cli-foreman-remote-execution.po → hammer_cli_foreman_remote_execution.po} +55 -16
- data/locale/es/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/es/hammer_cli_foreman_remote_execution.po +308 -0
- data/locale/fr/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/fr/hammer_cli_foreman_remote_execution.po +315 -0
- data/locale/{hammer-cli-foreman-remote-execution.pot → hammer_cli_foreman_remote_execution.pot} +113 -57
- data/locale/it/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/it/{hammer-cli-foreman-remote-execution.po → hammer_cli_foreman_remote_execution.po} +74 -37
- data/locale/ja/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/ja/hammer_cli_foreman_remote_execution.po +306 -0
- data/locale/ka/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/ka/hammer_cli_foreman_remote_execution.po +307 -0
- data/locale/ko/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/ko/hammer_cli_foreman_remote_execution.po +305 -0
- data/locale/pt_BR/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/pt_BR/hammer_cli_foreman_remote_execution.po +308 -0
- data/locale/ru/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/ru/hammer_cli_foreman_remote_execution.po +311 -0
- data/locale/zh_CN/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/zh_CN/hammer_cli_foreman_remote_execution.po +303 -0
- data/locale/zh_TW/LC_MESSAGES/hammer_cli_foreman_remote_execution.mo +0 -0
- data/locale/zh_TW/{hammer-cli-foreman-remote-execution.po → hammer_cli_foreman_remote_execution.po} +113 -73
- data/test/unit/foreign_input_set_test.rb +11 -9
- data/test/unit/job_invocation_test.rb +20 -16
- data/test/unit/job_template_test.rb +27 -22
- data/test/unit/remote_execution_feature_test.rb +9 -8
- data/test/unit/template_input_test.rb +13 -11
- metadata +39 -17
- data/locale/es/hammer-cli-foreman-remote-execution.po +0 -262
- data/locale/fr/hammer-cli-foreman-remote-execution.po +0 -262
- data/locale/ja/hammer-cli-foreman-remote-execution.po +0 -262
- data/locale/ko/hammer-cli-foreman-remote-execution.po +0 -262
- data/locale/pt_BR/hammer-cli-foreman-remote-execution.po +0 -263
- data/locale/ru/hammer-cli-foreman-remote-execution.po +0 -264
- data/locale/zh_CN/hammer-cli-foreman-remote-execution.po +0 -263
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90e3a16f1acf556e56d0e4302d47a1dc408c110d002b012b674abc2c8ae79251
|
4
|
+
data.tar.gz: 8a8eb33d582b2cd246fe51b458fc0829cb4ea3d553c3a320c6d84e20b5a7cce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18e67331e046360e779fc47d0df68e3e4e14accf8bf5c9a7095b2cad813e72f375e3264b15604763866b4c06d4b75bb8990e54316c0e3632e0cf044fe55ed10c
|
7
|
+
data.tar.gz: 343b148c08a660e02366e6098918514db6c6e5eacd0297ff665417b06b6785d100228b70826b686d6faaea296ca828ae003f99ffe333d8ba31520087f2fe0ec6
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: CI
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- "master"
|
7
|
+
concurrency:
|
8
|
+
group: ${{ github.ref_name }}-${{ github.workflow }}
|
9
|
+
cancel-in-progress: true
|
10
|
+
jobs:
|
11
|
+
rubocop:
|
12
|
+
name: Rubocop
|
13
|
+
uses: theforeman/actions/.github/workflows/rubocop.yml@v0
|
14
|
+
with:
|
15
|
+
command: bundle exec rubocop --parallel --format github
|
16
|
+
|
17
|
+
test:
|
18
|
+
name: Tests
|
19
|
+
needs: rubocop
|
20
|
+
uses: theforeman/actions/.github/workflows/test-gem.yml@v0
|
21
|
+
with:
|
22
|
+
command: bundle exec rake test
|
data/.rubocop.yml
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
-
|
2
|
-
Max: 100
|
1
|
+
inherit_from: .rubocop_todo.yml
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
inherit_gem:
|
4
|
+
theforeman-rubocop:
|
5
|
+
- lenient.yml
|
6
|
+
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 2.7
|
6
9
|
|
7
10
|
Style/HashSyntax:
|
8
11
|
EnforcedStyle: hash_rockets
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2024-08-02 06:59:11 UTC using RuboCop version 1.64.1.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
11
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
12
|
+
# SupportedStyles: with_first_element, with_fixed_indentation
|
13
|
+
Layout/ArrayAlignment:
|
14
|
+
Exclude:
|
15
|
+
- 'test/unit/job_invocation_test.rb'
|
16
|
+
|
17
|
+
# Offense count: 1
|
18
|
+
# Configuration parameters: MaximumRangeSize.
|
19
|
+
Lint/MissingCopEnableDirective:
|
20
|
+
Exclude:
|
21
|
+
- 'test/unit/template_input_test.rb'
|
22
|
+
|
23
|
+
# Offense count: 3
|
24
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
25
|
+
Metrics/AbcSize:
|
26
|
+
Max: 21
|
27
|
+
|
28
|
+
# Offense count: 3
|
29
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
30
|
+
# AllowedMethods: refine
|
31
|
+
Metrics/BlockLength:
|
32
|
+
Max: 82
|
33
|
+
|
34
|
+
# Offense count: 1
|
35
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
36
|
+
Metrics/CyclomaticComplexity:
|
37
|
+
Max: 8
|
38
|
+
|
39
|
+
# Offense count: 3
|
40
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
41
|
+
Metrics/MethodLength:
|
42
|
+
Max: 13
|
43
|
+
|
44
|
+
# Offense count: 4
|
45
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
46
|
+
# Configuration parameters: Include.
|
47
|
+
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
|
48
|
+
Rails/Output:
|
49
|
+
Exclude:
|
50
|
+
- 'lib/hammer_cli_foreman_remote_execution/job_invocation.rb'
|
51
|
+
- 'lib/hammer_cli_foreman_remote_execution/job_template.rb'
|
52
|
+
|
53
|
+
# Offense count: 1
|
54
|
+
# This cop supports safe autocorrection (--autocorrect).
|
55
|
+
# Configuration parameters: EnforcedStyle, Include.
|
56
|
+
# SupportedStyles: assert_not, refute
|
57
|
+
# Include: **/test/**/*
|
58
|
+
Rails/RefuteMethods:
|
59
|
+
Exclude:
|
60
|
+
- 'test/unit/job_invocation_test.rb'
|
61
|
+
|
62
|
+
# Offense count: 4
|
63
|
+
# This cop supports safe autocorrection (--autocorrect).
|
64
|
+
# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
|
65
|
+
# SupportedStyles: annotated, template, unannotated
|
66
|
+
# AllowedMethods: redirect
|
67
|
+
Style/FormatStringToken:
|
68
|
+
EnforcedStyle: template
|
69
|
+
|
70
|
+
# Offense count: 1
|
71
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
72
|
+
Style/HashTransformValues:
|
73
|
+
Exclude:
|
74
|
+
- 'lib/hammer_cli_foreman_remote_execution/options/normalizers.rb'
|
75
|
+
|
76
|
+
# Offense count: 5
|
77
|
+
# This cop supports safe autocorrection (--autocorrect).
|
78
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
|
79
|
+
# URISchemes: http, https
|
80
|
+
Layout/LineLength:
|
81
|
+
Max: 208
|
data/.tx/config
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
[main]
|
2
|
-
host = https://
|
2
|
+
host = https://app.transifex.com
|
3
3
|
|
4
|
-
[foreman
|
5
|
-
file_filter = locale/<lang>/
|
6
|
-
source_file = locale/
|
4
|
+
[o:foreman:p:foreman:r:hammer_cli_foreman_remote_execution]
|
5
|
+
file_filter = locale/<lang>/hammer_cli_foreman_remote_execution.edit.po
|
6
|
+
source_file = locale/hammer_cli_foreman_remote_execution.pot
|
7
7
|
source_lang = en
|
8
8
|
type = PO
|
9
|
+
resource_name = hammer_cli_foreman_remote_execution
|
data/Gemfile
CHANGED
@@ -1,24 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
gemspec
|
4
6
|
|
7
|
+
gem 'fast_gettext', '< 1.2.0' if RUBY_VERSION < '2.1.0'
|
5
8
|
gem 'gettext', '>= 3.1.3', '< 4.0.0'
|
6
|
-
if RUBY_VERSION < '2.1.0'
|
7
|
-
gem 'fast_gettext', '< 1.2.0'
|
8
|
-
end
|
9
9
|
|
10
10
|
group :test do
|
11
|
-
gem '
|
12
|
-
gem '
|
13
|
-
gem 'minitest', '< 4.7.4'
|
11
|
+
gem 'ci_reporter', '>= 1.6.3', '< 2.0.0', :require => false
|
12
|
+
gem 'minitest', '>= 5.1'
|
14
13
|
gem 'minitest-spec-context'
|
15
|
-
gem 'simplecov'
|
16
14
|
gem 'mocha'
|
17
|
-
gem '
|
15
|
+
gem 'rake', '~> 13.1.0'
|
16
|
+
gem 'simplecov'
|
17
|
+
gem 'theforeman-rubocop', '~> 0.1.0'
|
18
|
+
gem 'thor'
|
18
19
|
end
|
19
20
|
|
20
21
|
# load local gemfile
|
21
22
|
['Gemfile.local.rb', 'Gemfile.local'].map do |file_name|
|
22
23
|
local_gemfile = File.join(File.dirname(__FILE__), file_name)
|
23
|
-
|
24
|
+
instance_eval(Bundler.read_file(local_gemfile)) if File.exist?(local_gemfile)
|
24
25
|
end
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'bundler/gem_tasks'
|
2
4
|
require 'rake/testtask'
|
3
5
|
require 'ci/reporter/rake/minitest'
|
@@ -6,31 +8,7 @@ Rake::TestTask.new :test do |t|
|
|
6
8
|
t.libs.push "lib"
|
7
9
|
t.test_files = Dir.glob('test/**/*_test.rb')
|
8
10
|
t.verbose = true
|
9
|
-
|
10
|
-
|
11
|
-
namespace :gettext do
|
12
|
-
|
13
|
-
task :setup do
|
14
|
-
require "hammer_cli_foreman_remote_execution/version"
|
15
|
-
require "hammer_cli_foreman_remote_execution/i18n"
|
16
|
-
require 'gettext/tools/task'
|
17
|
-
|
18
|
-
domain = HammerCLIForemanRemoteExecution::I18n::LocaleDomain.new
|
19
|
-
GetText::Tools::Task.define do |task|
|
20
|
-
task.package_name = domain.domain_name
|
21
|
-
task.package_version = HammerCLIForemanRemoteExecution.version.to_s
|
22
|
-
task.domain = domain.domain_name
|
23
|
-
task.mo_base_directory = domain.locale_dir
|
24
|
-
task.po_base_directory = domain.locale_dir
|
25
|
-
task.files = domain.translated_files
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
desc "Update pot file"
|
30
|
-
task :find => [:setup] do
|
31
|
-
Rake::Task["gettext:po:update"].invoke
|
32
|
-
end
|
33
|
-
|
11
|
+
t.warning = ENV.key?('RUBY_WARNINGS')
|
34
12
|
end
|
35
13
|
|
36
14
|
namespace :pkg do
|
@@ -39,3 +17,9 @@ namespace :pkg do
|
|
39
17
|
end
|
40
18
|
|
41
19
|
task :default => :test
|
20
|
+
|
21
|
+
require "hammer_cli_foreman_remote_execution/version"
|
22
|
+
require "hammer_cli_foreman_remote_execution/i18n"
|
23
|
+
require "hammer_cli/i18n/find_task"
|
24
|
+
HammerCLI::I18n::FindTask.define(HammerCLIForemanRemoteExecution::I18n::LocaleDomain.new,
|
25
|
+
HammerCLIForemanRemoteExecution.version.to_s)
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path('lib/hammer_cli_foreman_remote_execution/version', __dir__)
|
2
4
|
|
3
5
|
Gem::Specification.new do |s|
|
4
6
|
s.name = 'hammer_cli_foreman_remote_execution'
|
@@ -10,7 +12,7 @@ Gem::Specification.new do |s|
|
|
10
12
|
s.license = 'GPL-3.0-or-later'
|
11
13
|
|
12
14
|
s.summary = 'CLI for the Foreman remote execution plugin'
|
13
|
-
s.description = 'CLI for the Foreman remote execution plugin'
|
15
|
+
s.description = 'This gem provides CLI support for the Foreman remote execution plugin'
|
14
16
|
|
15
17
|
s.files = `git ls-files`.split("\n")
|
16
18
|
s.test_files = `git ls-files test`.split("\n")
|
@@ -18,4 +20,6 @@ Gem::Specification.new do |s|
|
|
18
20
|
|
19
21
|
s.add_dependency 'hammer_cli_foreman', '>= 0.1.3', '< 4.0.0'
|
20
22
|
s.add_dependency 'hammer_cli_foreman_tasks', '~> 0.0.3'
|
23
|
+
|
24
|
+
s.required_ruby_version = '>= 2.7', '< 4'
|
21
25
|
end
|
@@ -1,10 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'hammer_cli/i18n'
|
2
4
|
|
3
5
|
module HammerCLIForemanRemoteExecution
|
4
6
|
module I18n
|
5
|
-
|
6
7
|
class LocaleDomain < HammerCLI::I18n::LocaleDomain
|
7
|
-
|
8
8
|
def translated_files
|
9
9
|
Dir.glob(File.join(File.dirname(__FILE__), '../**/*.rb'))
|
10
10
|
end
|
@@ -14,20 +14,18 @@ module HammerCLIForemanRemoteExecution
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def domain_name
|
17
|
-
'
|
17
|
+
'hammer_cli_foreman_remote_execution'
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
class SystemLocaleDomain < LocaleDomain
|
22
|
-
|
23
22
|
def locale_dir
|
24
23
|
'/usr/share/locale'
|
25
24
|
end
|
26
|
-
|
27
25
|
end
|
28
|
-
|
29
26
|
end
|
30
27
|
end
|
31
28
|
|
32
|
-
domain = [HammerCLIForemanRemoteExecution::I18n::LocaleDomain.new,
|
29
|
+
domain = [HammerCLIForemanRemoteExecution::I18n::LocaleDomain.new,
|
30
|
+
HammerCLIForemanRemoteExecution::I18n::SystemLocaleDomain.new].find(&:available?)
|
33
31
|
HammerCLI::I18n.add_domain(domain) if domain
|
@@ -16,9 +16,9 @@ module HammerCLIForemanRemoteExecution
|
|
16
16
|
type = super(nic)
|
17
17
|
if nic['execution']
|
18
18
|
if nic['primary'] || nic['provision']
|
19
|
-
type[-1] = ', '+_('execution') +')'
|
19
|
+
type[-1] = ', ' + _('execution') + ')'
|
20
20
|
else
|
21
|
-
type += ' ('+_('execution') +')'
|
21
|
+
type += ' (' + _('execution') + ')'
|
22
22
|
end
|
23
23
|
end
|
24
24
|
type
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module HammerCLIForemanRemoteExecution
|
2
4
|
class JobInvocation < HammerCLIForeman::Command
|
3
5
|
resource :job_invocations
|
@@ -112,13 +114,13 @@ module HammerCLIForemanRemoteExecution
|
|
112
114
|
def execute
|
113
115
|
data = get_output
|
114
116
|
if data['delayed']
|
115
|
-
puts _('The job is scheduled to start at %{timestamp}')
|
117
|
+
puts format(_('The job is scheduled to start at %{timestamp}'), :timestamp => data['start_at'])
|
116
118
|
return HammerCLI::EX_OK if option_async?
|
117
119
|
end
|
118
120
|
since = print_data(data)
|
119
121
|
|
120
122
|
output_loop(data, since)
|
121
|
-
|
123
|
+
HammerCLI::EX_OK
|
122
124
|
end
|
123
125
|
|
124
126
|
build_options do |o|
|
@@ -129,7 +131,7 @@ module HammerCLIForemanRemoteExecution
|
|
129
131
|
private
|
130
132
|
|
131
133
|
def output_loop(data, since = nil)
|
132
|
-
while data['refresh'] && !option_async?
|
134
|
+
while data['refresh'] && !option_async?
|
133
135
|
sleep 1
|
134
136
|
data = get_output(since)
|
135
137
|
since = print_data(data)
|
@@ -186,7 +188,7 @@ module HammerCLIForemanRemoteExecution
|
|
186
188
|
super(task)
|
187
189
|
end
|
188
190
|
|
189
|
-
|
191
|
+
alias_method :original_option_async?, :option_async?
|
190
192
|
|
191
193
|
def option_async?
|
192
194
|
if immediate?
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module HammerCLIForemanRemoteExecution
|
2
4
|
class JobTemplate < HammerCLIForeman::Command
|
3
5
|
resource :job_templates
|
@@ -45,8 +47,8 @@ module HammerCLIForemanRemoteExecution
|
|
45
47
|
|
46
48
|
class CreateCommand < HammerCLIForeman::CreateCommand
|
47
49
|
option '--file', 'TEMPLATE', N_('Path to a file that contains the template'),
|
48
|
-
|
49
|
-
|
50
|
+
:attribute_name => :option_template, :required => true,
|
51
|
+
:format => HammerCLI::Options::Normalizers::File.new
|
50
52
|
|
51
53
|
success_message _('Job template created')
|
52
54
|
failure_message _('Could not create the job template')
|
@@ -61,8 +63,8 @@ module HammerCLIForemanRemoteExecution
|
|
61
63
|
action :import
|
62
64
|
|
63
65
|
option '--file', 'TEMPLATE', N_('Path to a file that contains the template - must include ERB metadata'),
|
64
|
-
|
65
|
-
|
66
|
+
:attribute_name => :option_template, :required => true,
|
67
|
+
:format => HammerCLI::Options::Normalizers::File.new
|
66
68
|
|
67
69
|
success_message _('Job template imported')
|
68
70
|
failure_message _('Could not import the job template')
|
@@ -87,8 +89,8 @@ module HammerCLIForemanRemoteExecution
|
|
87
89
|
|
88
90
|
class UpdateCommand < HammerCLIForeman::UpdateCommand
|
89
91
|
option '--file', 'TEMPLATE', N_('Path to a file that contains the template'),
|
90
|
-
|
91
|
-
|
92
|
+
:attribute_name => :option_template,
|
93
|
+
:format => HammerCLI::Options::Normalizers::File.new
|
92
94
|
|
93
95
|
success_message _('Job template updated')
|
94
96
|
failure_message _('Could not update the job template')
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module HammerCLIForemanRemoteExecution
|
2
4
|
module Options
|
3
5
|
module Normalizers
|
@@ -11,11 +13,11 @@ module HammerCLIForemanRemoteExecution
|
|
11
13
|
end
|
12
14
|
|
13
15
|
def complete(value)
|
14
|
-
Dir[value.to_s+'*'].collect do |file|
|
16
|
+
Dir[value.to_s + '*'].collect do |file|
|
15
17
|
if ::File.directory?(file)
|
16
|
-
file+'/'
|
18
|
+
file + '/'
|
17
19
|
else
|
18
|
-
file+' '
|
20
|
+
file + ' '
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module HammerCLIForemanRemoteExecution
|
2
4
|
class RemoteExecutionFeature < HammerCLIForeman::Command
|
3
5
|
resource :remote_execution_features
|
@@ -37,5 +39,6 @@ module HammerCLIForemanRemoteExecution
|
|
37
39
|
autoload_subcommands
|
38
40
|
end
|
39
41
|
|
40
|
-
HammerCLI::MainCommand.subcommand 'remote-execution-feature', _('Manage remote execution features'),
|
42
|
+
HammerCLI::MainCommand.subcommand 'remote-execution-feature', _('Manage remote execution features'),
|
43
|
+
RemoteExecutionFeature
|
41
44
|
end
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'hammer_cli_foreman/subnet'
|
2
4
|
|
3
5
|
module HammerCLIForemanRemoteExecution
|
4
6
|
class SubnetExtensions < ::HammerCLI::CommandExtensions
|
5
7
|
output do |definition|
|
6
|
-
definition.insert(:after, _("Smart Proxies"))do
|
8
|
+
definition.insert(:after, _("Smart Proxies")) do
|
7
9
|
collection :remote_execution_proxies, _('Remote execution proxies'), :numbered => false do
|
8
10
|
field :id, _('Id')
|
9
11
|
field :name, _('Name')
|
data/locale/Makefile
CHANGED
@@ -1,57 +1,6 @@
|
|
1
1
|
#
|
2
2
|
# Makefile for PO merging and MO generation. More info in the README.
|
3
3
|
#
|
4
|
-
# make
|
5
|
-
# make check - check translations using translate-tool
|
6
|
-
# make tx-update - download and merge translations from Transifex
|
7
|
-
# make clean - clean everything
|
4
|
+
# Run make help to list available targets
|
8
5
|
#
|
9
|
-
|
10
|
-
VERSION = $(shell ruby -e 'require "rubygems";spec = Gem::Specification::load("../hammer_cli_foreman_remote_execution.gemspec");puts spec.version')
|
11
|
-
POTFILE = $(DOMAIN).pot
|
12
|
-
MOFILE = $(DOMAIN).mo
|
13
|
-
POFILES = $(shell find . -name '$(DOMAIN).po')
|
14
|
-
MOFILES = $(patsubst %.po,%.mo,$(POFILES))
|
15
|
-
POXFILES = $(patsubst %.po,%.pox,$(POFILES))
|
16
|
-
EDITFILES = $(patsubst %.po,%.edit.po,$(POFILES))
|
17
|
-
|
18
|
-
%.mo: %.po
|
19
|
-
mkdir -p $(shell dirname $@)/LC_MESSAGES
|
20
|
-
msgfmt -o $(shell dirname $@)/LC_MESSAGES/$(MOFILE) $<
|
21
|
-
|
22
|
-
# Generate MO files from PO files
|
23
|
-
all-mo: $(MOFILES)
|
24
|
-
|
25
|
-
# Check for malformed strings
|
26
|
-
%.pox: %.po
|
27
|
-
msgfmt -c $<
|
28
|
-
pofilter --nofuzzy -t variables -t blank -t urls -t emails -t long -t newlines \
|
29
|
-
-t endwhitespace -t endpunc -t puncspacing -t options -t printf -t validchars --gnome $< > $@
|
30
|
-
cat $@
|
31
|
-
! grep -q msgid $@
|
32
|
-
|
33
|
-
check: $(POXFILES)
|
34
|
-
|
35
|
-
# Unify duplicate translations
|
36
|
-
uniq-po:
|
37
|
-
for f in $(shell find ./ -name "*.po") ; do \
|
38
|
-
msguniq $$f -o $$f ; \
|
39
|
-
done
|
40
|
-
|
41
|
-
tx-pull: $(EDITFILES)
|
42
|
-
tx pull -f
|
43
|
-
for f in $(POFILES) ; do \
|
44
|
-
sed -i 's/^\("Project-Id-Version: \).*$$/\1$(DOMAIN) $(VERSION)\\n"/' $$f; \
|
45
|
-
done
|
46
|
-
|
47
|
-
# Extract strings and update the .pot, prepare .edit.po files
|
48
|
-
extract-strings:
|
49
|
-
bundle exec rake gettext:find
|
50
|
-
|
51
|
-
# Merge .edit.po into .po
|
52
|
-
update-po:
|
53
|
-
bundle exec rake gettext:find
|
54
|
-
|
55
|
-
tx-update: extract-strings tx-pull $(MOFILES)
|
56
|
-
git commit -m "i18n - extracting new, pulling from tx" ../locale
|
57
|
-
-echo Changes commited!
|
6
|
+
include $(shell bundle exec ruby -e 'require "hammer_cli"; puts HammerCLI::I18n.main_makefile')
|
Binary file
|