machinery-tool 1.22.1 → 1.22.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.git_revision +1 -1
  3. data/NEWS +10 -0
  4. data/bin/machinery +1 -1
  5. data/lib/analyze_changed_config_files_diffs_task.rb +6 -6
  6. data/lib/autoyast.rb +2 -2
  7. data/lib/build_task.rb +10 -7
  8. data/lib/cli.rb +1005 -801
  9. data/lib/compare_task.rb +11 -7
  10. data/lib/comparison.rb +2 -2
  11. data/lib/config_base.rb +1 -1
  12. data/lib/config_task.rb +1 -1
  13. data/lib/containerize_task.rb +3 -3
  14. data/lib/containerized_app.rb +1 -1
  15. data/lib/copy_task.rb +1 -1
  16. data/lib/current_user.rb +1 -1
  17. data/lib/deploy_task.rb +6 -4
  18. data/lib/diff_widget.rb +67 -63
  19. data/lib/docker_system.rb +12 -8
  20. data/lib/dpkg_database.rb +1 -1
  21. data/lib/element_filter.rb +7 -4
  22. data/lib/exceptions.rb +23 -5
  23. data/lib/export_task.rb +1 -1
  24. data/lib/exporter.rb +1 -1
  25. data/lib/file_diff.rb +1 -1
  26. data/lib/file_scope.rb +1 -1
  27. data/lib/file_validator.rb +7 -4
  28. data/lib/filter.rb +97 -93
  29. data/lib/filter_option_parser.rb +2 -2
  30. data/lib/hint.rb +64 -59
  31. data/lib/html.rb +1 -1
  32. data/lib/inspect_task.rb +12 -12
  33. data/lib/inspector.rb +3 -3
  34. data/lib/json_validation_error_cleaner.rb +1 -1
  35. data/lib/json_validator.rb +4 -4
  36. data/lib/kiwi_config.rb +8 -4
  37. data/lib/list_task.rb +10 -9
  38. data/lib/local_system.rb +11 -5
  39. data/lib/logged_cheetah.rb +1 -1
  40. data/lib/man_task.rb +10 -6
  41. data/lib/managed_files_database.rb +1 -1
  42. data/lib/manifest.rb +5 -5
  43. data/lib/migration.rb +16 -10
  44. data/lib/mountpoints.rb +1 -1
  45. data/lib/move_task.rb +1 -1
  46. data/lib/remote_system.rb +7 -7
  47. data/lib/remove_task.rb +1 -1
  48. data/lib/renderer.rb +177 -172
  49. data/lib/rpm.rb +4 -4
  50. data/lib/rpm_database.rb +1 -1
  51. data/lib/scope.rb +2 -2
  52. data/lib/scope_file_access_archive.rb +1 -1
  53. data/lib/scope_file_access_flat.rb +1 -1
  54. data/lib/scope_file_store.rb +1 -1
  55. data/lib/serve_html_task.rb +6 -2
  56. data/lib/server.rb +19 -12
  57. data/lib/show_task.rb +10 -6
  58. data/lib/static_html.rb +1 -1
  59. data/lib/system.rb +10 -10
  60. data/lib/system_description.rb +14 -13
  61. data/lib/system_description_memory_store.rb +1 -1
  62. data/lib/system_description_store.rb +9 -9
  63. data/lib/tarball.rb +8 -2
  64. data/lib/upgrade_format_task.rb +11 -6
  65. data/lib/validate_task.rb +2 -2
  66. data/lib/version.rb +1 -1
  67. data/lib/workload_mapper.rb +2 -2
  68. data/lib/workload_mapper_dsl.rb +1 -1
  69. data/lib/zypper.rb +40 -17
  70. data/machinery-helper/machinery_helper.go +35 -16
  71. data/machinery-helper/version.go +1 -1
  72. data/man/generated/machinery.1.gz +0 -0
  73. data/manual/site/sitemap.xml +24 -24
  74. data/plugins/changed_config_files/changed_config_files_inspector.rb +59 -56
  75. data/plugins/changed_config_files/changed_config_files_model.rb +23 -21
  76. data/plugins/changed_config_files/changed_config_files_renderer.rb +56 -52
  77. data/plugins/changed_managed_files/changed_managed_files_inspector.rb +52 -50
  78. data/plugins/changed_managed_files/changed_managed_files_model.rb +23 -21
  79. data/plugins/changed_managed_files/changed_managed_files_renderer.rb +43 -39
  80. data/plugins/environment/environment_inspector.rb +25 -23
  81. data/plugins/environment/environment_model.rb +5 -3
  82. data/plugins/groups/groups_inspector.rb +30 -28
  83. data/plugins/groups/groups_model.rb +18 -17
  84. data/plugins/groups/groups_renderer.rb +29 -25
  85. data/plugins/os/os_inspector.rb +120 -118
  86. data/plugins/os/os_model.rb +139 -134
  87. data/plugins/os/os_renderer.rb +13 -9
  88. data/plugins/packages/packages_inspector.rb +99 -86
  89. data/plugins/packages/packages_model.rb +35 -34
  90. data/plugins/packages/packages_renderer.rb +47 -39
  91. data/plugins/patterns/patterns_inspector.rb +70 -68
  92. data/plugins/patterns/patterns_model.rb +19 -18
  93. data/plugins/patterns/patterns_renderer.rb +36 -32
  94. data/plugins/repositories/repositories_inspector.rb +162 -156
  95. data/plugins/repositories/repositories_model.rb +50 -49
  96. data/plugins/repositories/repositories_renderer.rb +48 -44
  97. data/plugins/repositories/schema/system-description-repositories.schema-v10.json +0 -1
  98. data/plugins/services/services_inspector.rb +187 -176
  99. data/plugins/services/services_model.rb +37 -36
  100. data/plugins/services/services_renderer.rb +28 -24
  101. data/plugins/unmanaged_files/unmanaged_files_inspector.rb +102 -99
  102. data/plugins/unmanaged_files/unmanaged_files_model.rb +64 -56
  103. data/plugins/unmanaged_files/unmanaged_files_renderer.rb +44 -40
  104. data/plugins/users/users_inspector.rb +67 -65
  105. data/plugins/users/users_model.rb +37 -36
  106. data/plugins/users/users_renderer.rb +31 -27
  107. data/schema/migrations/migrate1to2.rb +1 -1
  108. data/schema/migrations/migrate2to3.rb +1 -1
  109. data/schema/migrations/migrate3to4.rb +1 -1
  110. data/schema/migrations/migrate4to5.rb +1 -1
  111. data/schema/migrations/migrate5to6.rb +1 -1
  112. data/schema/migrations/migrate6to7.rb +1 -1
  113. data/schema/migrations/migrate7to8.rb +1 -1
  114. data/schema/migrations/migrate8to9.rb +1 -1
  115. data/schema/migrations/migrate9to10.rb +1 -1
  116. metadata +2 -2
data/lib/compare_task.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class CompareTask
18
+ class Machinery::CompareTask
19
19
  def compare(description1, description2, scopes, options = {})
20
20
  if options[:show_html]
21
21
  render_html_comparison(description1, description2, scopes, options)
@@ -27,7 +27,7 @@ class CompareTask
27
27
  end
28
28
 
29
29
  def render_html_comparison(description1, description2, scopes, options)
30
- LocalSystem.validate_existence_of_command("xdg-open", "xdg-utils")
30
+ Machinery::LocalSystem.validate_existence_of_command("xdg-open", "xdg-utils")
31
31
 
32
32
  url = "http://#{options[:ip]}:#{options[:port]}/compare/" \
33
33
  "#{CGI.escape(description1.name)}/#{CGI.escape(description2.name)}"
@@ -39,8 +39,12 @@ Trying to start a web server for serving the comparison result on #{url}.
39
39
  The server can be closed with Ctrl+C.
40
40
  EOF
41
41
 
42
- server = Html.run_server(description1.store, port: options[:port], ip: options[:ip]) do
43
- LoggedCheetah.run("xdg-open", url)
42
+ server = Machinery::Html.run_server(
43
+ description1.store,
44
+ port: options[:port],
45
+ ip: options[:ip]
46
+ ) do
47
+ Machinery::LoggedCheetah.run("xdg-open", url)
44
48
  end
45
49
 
46
50
  server.join # Wait until the user cancelled the blocking webserver
@@ -53,9 +57,9 @@ EOF
53
57
  common_scopes = false
54
58
  scopes.each do |scope|
55
59
  if description1[scope] && description2[scope]
56
- comparison = Comparison.compare_scope(description1, description2, scope)
60
+ comparison = Machinery::Comparison.compare_scope(description1, description2, scope)
57
61
 
58
- output += Renderer.for(scope).render_comparison(comparison, options)
62
+ output += Machinery::Ui::Renderer.for(scope).render_comparison(comparison, options)
59
63
 
60
64
  if comparison.only_in1 || comparison.only_in2 || comparison.changed
61
65
  identical = false
@@ -64,7 +68,7 @@ EOF
64
68
  end
65
69
  common_scopes = true
66
70
  else
67
- output += Renderer.for(scope).render_comparison_missing_scope(
71
+ output += Machinery::Ui::Renderer.for(scope).render_comparison_missing_scope(
68
72
  description1, description2
69
73
  )
70
74
  identical = false if description1[scope] || description2[scope]
data/lib/comparison.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class Comparison
18
+ class Machinery::Comparison
19
19
  attr_accessor :name1, :name2, :only_in1, :only_in2, :changed, :common, :store, :scope
20
20
 
21
21
  def self.compare_scope(description1, description2, scope)
@@ -52,7 +52,7 @@ class Comparison
52
52
  raise "'which' has to be :one, :two or :common"
53
53
  end
54
54
 
55
- SystemDescription.new(name, store, scope => data)
55
+ Machinery::SystemDescription.new(name, store, scope => data)
56
56
  end
57
57
 
58
58
  def as_json
data/lib/config_base.rb CHANGED
@@ -19,7 +19,7 @@
19
19
  # The defaults for machinery's configuration are defined in
20
20
  # the file 'machinery_config.rb'.
21
21
 
22
- class ConfigBase
22
+ class Machinery::ConfigBase
23
23
  attr_reader :file, :entries
24
24
 
25
25
  def initialize(file = default_config_file)
data/lib/config_task.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class ConfigTask
18
+ class Machinery::ConfigTask
19
19
  def initialize(config = Machinery::Config.new)
20
20
  @config = config
21
21
  end
@@ -15,11 +15,11 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class ContainerizeTask
18
+ class Machinery::ContainerizeTask
19
19
  def containerize(description, dir)
20
20
  output_path = File.join(dir, description.name)
21
21
 
22
- mapper = WorkloadMapper.new
22
+ mapper = Machinery::WorkloadMapper.new
23
23
  workloads = mapper.identify_workloads(description)
24
24
 
25
25
  if workloads.empty?
@@ -48,7 +48,7 @@ class ContainerizeTask
48
48
  private
49
49
 
50
50
  def copy_workload_setup_files(description, workloads, services, path)
51
- app = ContainerizedApp.new(description.name, workloads, services)
51
+ app = Machinery::ContainerizedApp.new(description.name, workloads, services)
52
52
  workloads.each do |workload, _|
53
53
  Dir[File.join(Machinery::ROOT, "workload_mapper", workload, "setup", "*.erb")].each do |file|
54
54
  setup_script = ERB.new(File.read(file))
@@ -14,7 +14,7 @@
14
14
  #
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
- class ContainerizedApp
17
+ class Machinery::ContainerizedApp
18
18
  def initialize(name, workloads, services)
19
19
  @name = name
20
20
  @services = services
data/lib/copy_task.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class CopyTask
18
+ class Machinery::CopyTask
19
19
  def copy(store, from, to)
20
20
  store.copy(from, to)
21
21
  end
data/lib/current_user.rb CHANGED
@@ -16,7 +16,7 @@
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
18
  # Represents the user under which Machinery is running.
19
- class CurrentUser
19
+ class Machinery::CurrentUser
20
20
  def username
21
21
  ENV["USER"]
22
22
  end
data/lib/deploy_task.rb CHANGED
@@ -15,10 +15,12 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class DeployTask
18
+ class Machinery::DeployTask
19
19
  def deploy(description, cloud_config, options = {})
20
- LocalSystem.validate_architecture("x86_64")
21
- LocalSystem.validate_existence_of_packages(["python-glanceclient", "kiwi", "kiwi-desc-vmxboot"])
20
+ Machinery::LocalSystem.validate_architecture("x86_64")
21
+ Machinery::LocalSystem.validate_existence_of_packages(
22
+ ["python-glanceclient", "kiwi", "kiwi-desc-vmxboot"]
23
+ )
22
24
  description.validate_build_compatibility
23
25
 
24
26
  unless File.exist?(cloud_config)
@@ -37,7 +39,7 @@ class DeployTask
37
39
  else
38
40
  image_dir = Dir.mktmpdir("#{description.name}-image", "/tmp")
39
41
  is_temporary = true
40
- task = BuildTask.new
42
+ task = Machinery::BuildTask.new
41
43
  task.build(description, image_dir)
42
44
  end
43
45
 
data/lib/diff_widget.rb CHANGED
@@ -1,73 +1,77 @@
1
- class DiffWidget
2
- def initialize(diff_text)
3
- diff = Machinery.scrub(diff_text)
4
- @lines = diff.lines[2..-1]
5
- @widget = {
6
- file: diff[/--- a(.*)/, 1],
7
- additions: @lines.select { |l| l.start_with?("+") }.length,
8
- deletions: @lines.select { |l| l.start_with?("-") }.length
9
- }
1
+ module Machinery
2
+ class Ui
3
+ class DiffWidget
4
+ def initialize(diff_text)
5
+ diff = Machinery.scrub(diff_text)
6
+ @lines = diff.lines[2..-1]
7
+ @widget = {
8
+ file: diff[/--- a(.*)/, 1],
9
+ additions: @lines.select { |l| l.start_with?("+") }.length,
10
+ deletions: @lines.select { |l| l.start_with?("-") }.length
11
+ }
10
12
 
11
- @original_line_number = 0
12
- @new_line_number = 0
13
- end
14
-
15
- def widget
16
- @widget[:lines] = @lines.map do |line|
17
- line = ERB::Util.html_escape(line.chomp).gsub("\\", "\").gsub("\t", " " * 8)
18
- case line
19
- when /^@.*/
20
- entry = header_entry(line)
21
- @original_line_number = line[/-(\d+)/, 1].to_i
22
- @new_line_number = line[/\+(\d+)/, 1].to_i
23
- when /^ .*/, ""
24
- entry = common_entry(line)
25
- @new_line_number += 1
26
- @original_line_number += 1
27
- when /^\+.*/
28
- entry = addition_entry(line)
29
- @new_line_number += 1
30
- when /^\-.*/
31
- entry = deletion_entry(line)
32
- @original_line_number += 1
13
+ @original_line_number = 0
14
+ @new_line_number = 0
33
15
  end
34
16
 
35
- entry
36
- end
37
- @widget
38
- end
17
+ def widget
18
+ @widget[:lines] = @lines.map do |line|
19
+ line = ERB::Util.html_escape(line.chomp).gsub("\\", "\").gsub("\t", " " * 8)
20
+ case line
21
+ when /^@.*/
22
+ entry = header_entry(line)
23
+ @original_line_number = line[/-(\d+)/, 1].to_i
24
+ @new_line_number = line[/\+(\d+)/, 1].to_i
25
+ when /^ .*/, ""
26
+ entry = common_entry(line)
27
+ @new_line_number += 1
28
+ @original_line_number += 1
29
+ when /^\+.*/
30
+ entry = addition_entry(line)
31
+ @new_line_number += 1
32
+ when /^\-.*/
33
+ entry = deletion_entry(line)
34
+ @original_line_number += 1
35
+ end
39
36
 
40
- private
37
+ entry
38
+ end
39
+ @widget
40
+ end
41
41
 
42
- def header_entry(line)
43
- {
44
- type: "header",
45
- content: line
46
- }
47
- end
42
+ private
48
43
 
49
- def common_entry(line)
50
- {
51
- type: "common",
52
- new_line_number: @new_line_number,
53
- original_line_number: @original_line_number,
54
- content: line[1..-1]
55
- }
56
- end
44
+ def header_entry(line)
45
+ {
46
+ type: "header",
47
+ content: line
48
+ }
49
+ end
57
50
 
58
- def addition_entry(line)
59
- {
60
- type: "addition",
61
- new_line_number: @new_line_number,
62
- content: line[1..-1]
63
- }
64
- end
51
+ def common_entry(line)
52
+ {
53
+ type: "common",
54
+ new_line_number: @new_line_number,
55
+ original_line_number: @original_line_number,
56
+ content: line[1..-1]
57
+ }
58
+ end
65
59
 
66
- def deletion_entry(line)
67
- {
68
- type: "deletion",
69
- original_line_number: @original_line_number,
70
- content: line[1..-1]
71
- }
60
+ def addition_entry(line)
61
+ {
62
+ type: "addition",
63
+ new_line_number: @new_line_number,
64
+ content: line[1..-1]
65
+ }
66
+ end
67
+
68
+ def deletion_entry(line)
69
+ {
70
+ type: "deletion",
71
+ original_line_number: @original_line_number,
72
+ content: line[1..-1]
73
+ }
74
+ end
75
+ end
72
76
  end
73
77
  end
data/lib/docker_system.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class DockerSystem < System
18
+ class Machinery::DockerSystem < Machinery::System
19
19
  attr_accessor :image
20
20
 
21
21
  def type
@@ -29,19 +29,21 @@ class DockerSystem < System
29
29
  end
30
30
 
31
31
  def start
32
- @container = LoggedCheetah.run("docker", "run", "-id", @image, "bash", stdout: :capture).chomp
32
+ @container = Machinery::LoggedCheetah.run(
33
+ "docker", "run", "-id", @image, "bash", stdout: :capture
34
+ ).chomp
33
35
  rescue Cheetah::ExecutionFailed => e
34
36
  raise Machinery::Errors::MachineryError, "Container could not be started." \
35
37
  " The error message was:\n" + e.stderr
36
38
  end
37
39
 
38
40
  def stop
39
- LoggedCheetah.run("docker", "rm", "-f", @container) if @container
41
+ Machinery::LoggedCheetah.run("docker", "rm", "-f", @container) if @container
40
42
  end
41
43
 
42
44
  def run_command(*args)
43
45
  Machinery.logger.info("Running '#{args}'")
44
- LoggedCheetah.run("docker", "exec", "--user=root", "-i", @container, *args)
46
+ Machinery::LoggedCheetah.run("docker", "exec", "--user=root", "-i", @container, *args)
45
47
  end
46
48
 
47
49
  def check_retrieve_files_dependencies
@@ -76,7 +78,7 @@ class DockerSystem < System
76
78
 
77
79
  # Copies a file to the system
78
80
  def inject_file(source, destination)
79
- LoggedCheetah.run("docker", "cp", source, "#{@container}:#{destination}")
81
+ Machinery::LoggedCheetah.run("docker", "cp", source, "#{@container}:#{destination}")
80
82
  end
81
83
 
82
84
  # Retrieves files specified in file_list from the container
@@ -85,8 +87,10 @@ class DockerSystem < System
85
87
  destination_path = File.join(destination, file)
86
88
  FileUtils.mkdir_p(File.dirname(destination_path), mode: 0700)
87
89
 
88
- LoggedCheetah.run("docker", "cp", "#{@container}:#{file}", "#{destination_path}")
89
- LoggedCheetah.run("chmod", "go-rwx", destination_path)
90
+ Machinery::LoggedCheetah.run(
91
+ "docker", "cp", "#{@container}:#{file}", destination_path.to_s
92
+ )
93
+ Machinery::LoggedCheetah.run("chmod", "go-rwx", destination_path)
90
94
  end
91
95
  end
92
96
 
@@ -123,7 +127,7 @@ class DockerSystem < System
123
127
  private
124
128
 
125
129
  def validate_image_name(image)
126
- LoggedCheetah.run("docker", "inspect", image)
130
+ Machinery::LoggedCheetah.run("docker", "inspect", image)
127
131
  rescue
128
132
  raise Machinery::Errors::InspectionFailed.new("Unknown docker image: '#{image}'")
129
133
  end
data/lib/dpkg_database.rb CHANGED
@@ -15,7 +15,7 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class DpkgDatabase < ManagedFilesDatabase
18
+ class Machinery::DpkgDatabase < Machinery::ManagedFilesDatabase
19
19
  def managed_files_list(&block)
20
20
  message = "The list of changed config and managed files is not complete on dpkg systems."\
21
21
  " The reason for this is missing verification data:" \
@@ -15,7 +15,7 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class ElementFilter
18
+ class Machinery::ElementFilter
19
19
  attr_accessor :path, :matchers
20
20
 
21
21
  def initialize(path, operator = nil, matchers = nil)
@@ -34,7 +34,10 @@ class ElementFilter
34
34
  end
35
35
 
36
36
  def add_matchers(operator, matchers)
37
- unless [Filter::OPERATOR_EQUALS, Filter::OPERATOR_EQUALS_NOT].include?(operator)
37
+ unless [
38
+ Machinery::Filter::OPERATOR_EQUALS,
39
+ Machinery::Filter::OPERATOR_EQUALS_NOT
40
+ ].include?(operator)
38
41
  raise Machinery::Errors::InvalidFilter.new("Wrong filter operator '#{operator}'")
39
42
  end
40
43
 
@@ -66,9 +69,9 @@ class ElementFilter
66
69
  value == matcher
67
70
  end
68
71
  end
69
- if operator == Filter::OPERATOR_EQUALS
72
+ if operator == Machinery::Filter::OPERATOR_EQUALS
70
73
  return true if values_equal
71
- elsif operator == Filter::OPERATOR_EQUALS_NOT
74
+ elsif operator == Machinery::Filter::OPERATOR_EQUALS_NOT
72
75
  return true unless values_equal
73
76
  end
74
77
  end
data/lib/exceptions.rb CHANGED
@@ -28,7 +28,12 @@ module Machinery
28
28
  class MachineryError < StandardError; end
29
29
 
30
30
  class UnknownScope < MachineryError; end
31
- class UnknownOs < MachineryError; end
31
+ class UnknownOs < MachineryError
32
+ def to_s
33
+ "Unable to determine the operating system. There does not seem to be an" \
34
+ " /etc/os-release file."
35
+ end
36
+ end
32
37
  class InvalidPager < MachineryError; end
33
38
  class InvalidCommandLine < MachineryError; end
34
39
 
@@ -49,8 +54,9 @@ module Machinery
49
54
  if !@format_version
50
55
  "#{@name}: incompatible format version. Can not be upgraded."
51
56
  elsif @format_version < SystemDescription::CURRENT_FORMAT_VERSION
52
- "#{@name}: format version #{@format_version}, needs to be upgraded. " \
53
- "Try '#{Hint.program_name} upgrade-format #{name}' to upgrade it to the current version."
57
+ "#{@name}: format version #{@format_version}, needs to be upgraded. "\
58
+ "Try '#{Ui::Hint.program_name} upgrade-format #{name}'"\
59
+ " to upgrade it to the current version."
54
60
  else
55
61
  "#{@name}: format version #{@format_version}. " \
56
62
  "Please upgrade Machinery to the latest version."
@@ -76,7 +82,7 @@ module Machinery
76
82
  inspect_cmd = "inspect"
77
83
  end
78
84
 
79
- cmd = "#{Hint.program_name} #{inspect_cmd} --extract-files " \
85
+ cmd = "#{Ui::Hint.program_name} #{inspect_cmd} --extract-files " \
80
86
  "--scope=#{formatted_scopes.delete(" ")}"
81
87
  cmd += " --name='#{@description.name}'" if hostname != @description.name
82
88
  cmd += " #{hostname}"
@@ -124,6 +130,18 @@ module Machinery
124
130
  end
125
131
  end
126
132
 
133
+ class CommandFailed < MachineryError
134
+ def initialize(command, error)
135
+ @command = command
136
+ @error = error
137
+ end
138
+
139
+ def to_s
140
+ "The required call '#{@command}' does not seem to work as expected on the" \
141
+ " inspected system. This is the error message:\n#{@error}"
142
+ end
143
+ end
144
+
127
145
  class SudoMissingTTY < MachineryError
128
146
  def initialize(host)
129
147
  @host = host
@@ -131,7 +149,7 @@ module Machinery
131
149
 
132
150
  def to_s
133
151
  "'sudo' isn't configured on the inspected host '#{@host}'." \
134
- " Remove the RequireTTY settings from sudoers.conf."
152
+ " Remove the 'requiretty' settings from /etc/sudoers by running `visudo`."
135
153
  end
136
154
  end
137
155