machinery-tool 1.18.0 → 1.19.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/.git_revision +1 -1
  3. data/NEWS +17 -0
  4. data/bin/machinery +10 -2
  5. data/html/comparison.html.haml +1 -1
  6. data/html/index.html.haml +2 -2
  7. data/html/partials/{config_files.html.haml → changed_config_files.html.haml} +10 -10
  8. data/html/partials/compare/changed_config_files.html.haml +48 -0
  9. data/html/partials/compare/{config_file_list.html.haml → changed_config_files_list.html.haml} +0 -0
  10. data/html/partials/compare/unmanaged_file_list.html.haml +1 -1
  11. data/html/partials/compare/unmanaged_files.html.haml +2 -2
  12. data/html/partials/patterns.html.haml +5 -0
  13. data/html/upgrade.html.haml +49 -0
  14. data/lib/{analyze_config_file_diffs_task.rb → analyze_changed_config_files_diffs_task.rb} +8 -8
  15. data/lib/autoyast.rb +12 -13
  16. data/lib/build_task.rb +2 -2
  17. data/lib/cli.rb +39 -32
  18. data/lib/compare_task.rb +1 -1
  19. data/lib/config_base.rb +1 -1
  20. data/lib/deploy_task.rb +4 -4
  21. data/lib/docker_system.rb +1 -1
  22. data/lib/element_filter.rb +3 -3
  23. data/lib/export_task.rb +3 -3
  24. data/lib/file_validator.rb +8 -5
  25. data/lib/filter.rb +5 -5
  26. data/lib/filter_option_parser.rb +3 -3
  27. data/lib/hint.rb +9 -4
  28. data/lib/html.rb +3 -3
  29. data/lib/inspect_task.rb +3 -3
  30. data/lib/json_schema_monkey_patch.rb +2 -2
  31. data/lib/json_validation_error_cleaner.rb +1 -1
  32. data/lib/json_validator.rb +2 -2
  33. data/lib/kiwi_config.rb +39 -14
  34. data/lib/list_task.rb +1 -1
  35. data/lib/local_system.rb +4 -4
  36. data/lib/machinery.rb +1 -1
  37. data/lib/machinery_logger.rb +4 -4
  38. data/lib/manifest.rb +5 -5
  39. data/lib/migration.rb +4 -4
  40. data/lib/object.rb +6 -10
  41. data/lib/remove_task.rb +1 -1
  42. data/lib/renderer.rb +5 -5
  43. data/lib/scope_file_access_archive.rb +2 -2
  44. data/lib/scope_file_access_flat.rb +3 -3
  45. data/lib/scope_file_store.rb +3 -3
  46. data/lib/serve_html_task.rb +15 -2
  47. data/lib/server.rb +32 -12
  48. data/lib/system.rb +1 -1
  49. data/lib/system_description.rb +16 -14
  50. data/lib/system_description_store.rb +5 -6
  51. data/lib/ui.rb +1 -1
  52. data/lib/upgrade_format_task.rb +2 -2
  53. data/lib/version.rb +1 -1
  54. data/lib/workload_mapper.rb +11 -11
  55. data/lib/zypper.rb +1 -1
  56. data/machinery-helper/Rakefile +1 -1
  57. data/machinery-helper/version.go +1 -1
  58. data/man/generated/machinery.1.gz +0 -0
  59. data/manual/docs/machinery-analyze.1.md +3 -3
  60. data/manual/docs/machinery-compare.1.md +2 -2
  61. data/manual/docs/machinery-inspect-docker.1.md +1 -1
  62. data/manual/docs/machinery-inspect.1.md +4 -1
  63. data/manual/docs/machinery-show.1.md +2 -2
  64. data/manual/docs/machinery_main_general.1.md +1 -1
  65. data/manual/docs/machinery_main_scopes.1.md +8 -6
  66. data/manual/site/machinery-analyze.1/index.html +3 -3
  67. data/manual/site/machinery-compare.1/index.html +2 -2
  68. data/manual/site/machinery-inspect-docker.1/index.html +1 -1
  69. data/manual/site/machinery-inspect.1/index.html +3 -1
  70. data/manual/site/machinery-show.1/index.html +2 -2
  71. data/manual/site/machinery_main_general.1/index.html +1 -1
  72. data/manual/site/machinery_main_scopes.1/index.html +8 -6
  73. data/manual/site/mkdocs/search_index.json +17 -17
  74. data/manual/site/sitemap.xml +23 -23
  75. data/plugins/{config_files/config_files.yml → changed_config_files/changed_config_files.yml} +3 -3
  76. data/plugins/{config_files/config_files_inspector.rb → changed_config_files/changed_config_files_inspector.rb} +14 -10
  77. data/plugins/{config_files/config_files_model.rb → changed_config_files/changed_config_files_model.rb} +1 -1
  78. data/plugins/{config_files/config_files_renderer.rb → changed_config_files/changed_config_files_renderer.rb} +9 -9
  79. data/plugins/{config_files/schema/system-description-config-files.schema-v1.json → changed_config_files/schema/system-description-changed-config-files.schema-v1.json} +0 -0
  80. data/plugins/{config_files/schema/system-description-config-files.schema-v2.json → changed_config_files/schema/system-description-changed-config-files.schema-v2.json} +0 -0
  81. data/plugins/{config_files/schema/system-description-config-files.schema-v3.json → changed_config_files/schema/system-description-changed-config-files.schema-v3.json} +0 -0
  82. data/plugins/{config_files/schema/system-description-config-files.schema-v4.json → changed_config_files/schema/system-description-changed-config-files.schema-v4.json} +0 -0
  83. data/plugins/{config_files/schema/system-description-config-files.schema-v5.json → changed_config_files/schema/system-description-changed-config-files.schema-v5.json} +0 -0
  84. data/plugins/{config_files/schema/system-description-config-files.schema-v6.json → changed_config_files/schema/system-description-changed-config-files.schema-v6.json} +0 -0
  85. data/plugins/{config_files/schema/system-description-config-files.schema-v7.json → changed_config_files/schema/system-description-changed-config-files.schema-v7.json} +0 -0
  86. data/plugins/changed_config_files/schema/system-description-changed-config-files.schema-v8.json +160 -0
  87. data/plugins/changed_managed_files/changed_managed_files_inspector.rb +6 -2
  88. data/plugins/changed_managed_files/changed_managed_files_renderer.rb +1 -1
  89. data/plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v8.json +160 -0
  90. data/plugins/environment/schema/system-description-environment.schema-v8.json +17 -0
  91. data/plugins/groups/groups_inspector.rb +1 -1
  92. data/plugins/groups/groups_renderer.rb +1 -1
  93. data/plugins/groups/schema/system-description-groups.schema-v8.json +49 -0
  94. data/plugins/os/os_inspector.rb +6 -6
  95. data/plugins/os/os_renderer.rb +1 -1
  96. data/plugins/os/schema/system-description-os.schema-v8.json +21 -0
  97. data/plugins/packages/packages_inspector.rb +1 -1
  98. data/plugins/packages/schema/system-description-packages.schema-v8.json +115 -0
  99. data/plugins/patterns/patterns.yml +5 -3
  100. data/plugins/patterns/patterns_inspector.rb +4 -3
  101. data/plugins/patterns/patterns_renderer.rb +5 -1
  102. data/plugins/patterns/schema/system-description-patterns.schema-v8.json +58 -0
  103. data/plugins/repositories/repositories_inspector.rb +2 -1
  104. data/plugins/repositories/schema/system-description-repositories.schema-v8.json +165 -0
  105. data/plugins/services/schema/system-description-services.schema-v8.json +93 -0
  106. data/plugins/services/services.yml +1 -1
  107. data/plugins/services/services_inspector.rb +1 -1
  108. data/plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v8.json +124 -0
  109. data/plugins/unmanaged_files/unmanaged_files_inspector.rb +9 -4
  110. data/plugins/unmanaged_files/unmanaged_files_model.rb +12 -5
  111. data/plugins/unmanaged_files/unmanaged_files_renderer.rb +1 -1
  112. data/plugins/users/schema/system-description-users.schema-v8.json +86 -0
  113. data/plugins/users/users_inspector.rb +7 -7
  114. data/schema/migrations/migrate1to2.rb +4 -4
  115. data/schema/migrations/migrate2to3.rb +1 -1
  116. data/schema/migrations/migrate3to4.rb +9 -9
  117. data/schema/migrations/migrate7to8.rb +47 -0
  118. data/schema/system-description-global.schema-v8.json +43 -0
  119. data/workload_mapper/rails/setup/setup.rb.erb +1 -1
  120. data/workload_mapper/wordpress/setup/setup.rb.erb +1 -1
  121. metadata +31 -17
  122. data/html/partials/compare/config_files.html.haml +0 -48
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3862196a560a037acde60f2864df0bde8426cd9e
4
- data.tar.gz: 635959f588111bad3702a7d8eb134316ec339b13
3
+ metadata.gz: 2d349debbcb3d723bc63b0d88e167c740eefba7d
4
+ data.tar.gz: 7916e14996d43eaa7573874248a41e5eb951f70c
5
5
  SHA512:
6
- metadata.gz: 4fc553147b68761806a51fe5c078d792bb28c7bc38dfdf17e766c85c1fe3643dd3830122563885ccdd5d63d584114e17bb00ea880d4fb1029af24007c43c4e38
7
- data.tar.gz: ab2165ca7a37ad14e4b794ea7eeefca6905b84bd3911914ee9f113e46754a2e6b2876a5b893b2145466c42d8171078f143a57ba6a0623ac26df1f8f952af3285
6
+ metadata.gz: 72c3fb80b1ff276026fe17984ec495ae0ac5b3f5d4f6ce09a459eacb5cd7a968196f1074024a27d0e79e94ab1d9b6bb5973afb42b6deb924bd5c7457a94c32ee
7
+ data.tar.gz: 11a7aa1ebd52c08682c01367814b6c114b21685424bc0b94d70c23ed4ce9f2ce711f5277ab6565d0d9f30ec97c29e991d447518566964f178569d1911dc9ed04
data/.git_revision CHANGED
@@ -1 +1 @@
1
- 8df1e753fd5f3ef8a5bcfed6eb932b864acbebde
1
+ 2b9173e39c9aa1b627b29893d7374eae4378e029
data/NEWS CHANGED
@@ -1,6 +1,23 @@
1
1
  # Machinery Release Notes
2
2
 
3
3
 
4
+ ## Version 1.19.0 - Mon Apr 04 17:06:37 CEST 2016 - thardeck@suse.de
5
+
6
+ * Rename config-files inspector to changed-config-files inspector to be more
7
+ intuitive
8
+ * Following the previous change the analyze operation was also renamed to
9
+ changed-config-files-diffs
10
+ * Add explanation for patterns-tasks relationship for Debian based
11
+ systems (gh#SUSE/machinery#1820)
12
+ * Public serve task now prints hostname for sharing (gh#SUSE/machinery#1699)
13
+ * Fix export of description with no repositories scope to Autoyast (gh#SUSE/machinery#2024)
14
+ * Only use required packages for bootstrap in Kiwi export
15
+ * Fix regression which prevented changed-config-file diffs from being shown
16
+ in the HTML output
17
+ * Hint now mentions remote-user option (gh#SUSE/machinery#1813)
18
+ * Hint is printed when `machinery` is called without options (gh#SUSE/machinery#1286)
19
+ * Rename --exclude-scope option to --ignore-scope (gh#SUSE/machinery#897)
20
+
4
21
  ## Version 1.18.0 - Tue Mar 01 13:51:39 CET 2016 - thardeck@suse.de
5
22
 
6
23
  * Make the machinery-helper exclusive to improve inspection performance significantly
data/bin/machinery CHANGED
@@ -21,8 +21,16 @@ require_relative '../lib/machinery'
21
21
 
22
22
  begin
23
23
  if Dir.exist?(File.join(Machinery::ROOT, ".git"))
24
- Dir.chdir(File.join(Machinery::ROOT, "machinery-helper")) do
25
- Cheetah.run("rake", "build")
24
+ begin
25
+ Dir.chdir(File.join(Machinery::ROOT, "machinery-helper")) do
26
+ Cheetah.run("rake", "build")
27
+ end
28
+ rescue
29
+ STDERR.puts(
30
+ "ERROR: The official Go compiler is not available on this system which prevents the" \
31
+ " machinery-helper binaries from being built."
32
+ )
33
+ exit
26
34
  end
27
35
  end
28
36
 
@@ -22,7 +22,7 @@
22
22
 
23
23
  %body{ "data-description-a" => @description_a.name, "data-description-b" => @description_b.name }
24
24
  - scopes = ["os", "packages", "patterns", "repositories", "users", "groups",
25
- "services", "config_files", "changed_managed_files", "unmanaged_files"]
25
+ "services", "changed_config_files", "changed_managed_files", "unmanaged_files"]
26
26
  #diff-unmanaged-files.modal.fade
27
27
  .modal-dialog.modal-lg
28
28
  .modal-content
data/html/index.html.haml CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  %body{ "data-description" => @description.name }
20
20
  - scopes = ["os", "packages", "patterns", "repositories", "users", "groups",
21
- "services", "config_files", "changed_managed_files", "unmanaged_files"]
21
+ "services", "changed_config_files", "changed_managed_files", "unmanaged_files"]
22
22
  .modal.fade#file-modal{ "tabindex" => "-1" }
23
23
  .modal-dialog.modal-lg
24
24
  .modal-content
@@ -109,7 +109,7 @@
109
109
  .row
110
110
  .col-xs-1
111
111
  .col-xs-11
112
- - if !@description.filter_definitions("inspect").empty?
112
+ - unless @description.filter_definitions("inspect").empty?
113
113
  %ul
114
114
  - @description.filter_definitions("inspect").each do |filter|
115
115
  %li.filter
@@ -1,21 +1,21 @@
1
- - if config_files
1
+ - if changed_config_files
2
2
  %div
3
- %a.scope_anchor{ id: "config_files" }
4
- .scope#config_files_container{ "data-scope" => "config_files" }
5
- - count = config_files.length
3
+ %a.scope_anchor{ id: "changed_config_files" }
4
+ .scope#changed_config_files_container{ "data-scope" => "changed_config_files" }
5
+ - count = changed_config_files.length
6
6
  = render_partial "scope_header",
7
- :scope => "config_files",
8
- :title => "Config Files",
7
+ :scope => "changed_config_files",
8
+ :title => "Changed Configuration Files",
9
9
  :count => "#{count} #{Machinery.pluralize(count, "file")}"
10
10
  .row.scope_content.collapse.in
11
11
  .col-xs-1
12
12
  .col-xs-11
13
13
  %p
14
- <strong>Files extracted:</strong> #{config_files.extracted ? "yes" : "no"}
14
+ <strong>Files extracted:</strong> #{changed_config_files.extracted ? "yes" : "no"}
15
15
  - if count == 0
16
- There are no config files.
16
+ There are no changed configuration files.
17
17
  - if count > 0
18
- - config_files.each do |file|
18
+ - changed_config_files.each do |file|
19
19
  - if file.diff
20
20
  .diff{ style: "display: none", "data-config-file-diff" => file.diff.file }
21
21
  %span.diff-summary
@@ -38,7 +38,7 @@
38
38
  %th.small User
39
39
  %th.small Group
40
40
  %tbody
41
- - config_files.each do |file|
41
+ - changed_config_files.each do |file|
42
42
  %tr
43
43
  %td
44
44
  %span
@@ -0,0 +1,48 @@
1
+ - if @diff["changed_config_files"]
2
+ - scope = "changed_config_files"
3
+ %a.scope_anchor{ id: scope }
4
+ .scope#changed_config_files_container
5
+ .row
6
+ .col-xs-1
7
+ %a.btn.btn-default.btn-lg.scope_logo_big{ :href => "##{scope}",
8
+ :title => scope_title(scope), "data-toggle"=>"popover",
9
+ "data-content" => scope_help(scope) }
10
+ %span= scope_initials(scope)
11
+ %span.toggle{ title: "Collapse/Expand" }
12
+ .col-xs-11
13
+ %h2
14
+ Changed Config Files
15
+ = render_partial "compare/summary",
16
+ scope: "changed_config_files",
17
+ singular: "file",
18
+ plural: "files"
19
+ .row.scope_content.collapse.in
20
+ .col-md-12
21
+ .row
22
+ .col-xs-6.table_container
23
+ - if @diff["changed_config_files"].only_in1
24
+ = only_in_a
25
+ = render_partial "compare/changed_config_files_list", list: @diff["changed_config_files"].only_in1
26
+ .col-xs-6.table_container
27
+ - if @diff["changed_config_files"].only_in2
28
+ = only_in_b
29
+ = render_partial "compare/changed_config_files_list", list: @diff["changed_config_files"].only_in2
30
+ - if @diff["changed_config_files"].changed
31
+ %a.both_anchor{ id: "changed_config_files_changed" }
32
+ .row
33
+ .col-xs-12.table_container
34
+ = changed
35
+ = render_partial "compare/changes", changes: changed_elements("changed_config_files",
36
+ key: "name")
37
+ - if @diff["changed_config_files"].common
38
+ %a.both_anchor{ id: "changed_config_files_both" }
39
+ .row
40
+ .col-xs-12
41
+ %a.show-common-elements{ href: "#changed_config_files_both" }
42
+ Show common elements in changed-config-files
43
+ %a.hide-common-elements{ href: "#", style: "display: none" }
44
+ Hide common elements in changed-config-files
45
+ .row.scope_common_content.collapse
46
+ .col-xs-12.table_container
47
+ = in_both
48
+ = render_partial "compare/changed_config_files_list", list: @diff["changed_config_files"].common
@@ -1,4 +1,4 @@
1
- - if !list.extracted.nil?
1
+ - unless list.extracted.nil?
2
2
  %p
3
3
  <strong>Files extracted:</strong> #{list.extracted ? "yes" : "no"}
4
4
  - unless list.elements.empty?
@@ -26,7 +26,7 @@
26
26
  %a.show-changed-elements{ href: "#unmanaged_files_changed" }
27
27
  changed
28
28
  = ": #{pluralize_scope(@diff["unmanaged_files"].changed, "file", "files")}"
29
- - if @diff["unmanaged_files"].common
29
+ - unless @diff["unmanaged_files"].common.elements.empty?
30
30
  %span.summary-part
31
31
  %a.show-common-elements{ href: "#unmanaged_files_both" }<
32
32
  both
@@ -51,7 +51,7 @@
51
51
  = changed
52
52
  = render_partial "compare/changes", changes: changed_elements("unmanaged_files",
53
53
  key: "name")
54
- - if @diff["unmanaged_files"].common
54
+ - unless @diff["unmanaged_files"].common.elements.empty?
55
55
  %a.both_anchor{ id: "unmanaged_files_both" }
56
56
  .row
57
57
  .col-md-12
@@ -6,6 +6,11 @@
6
6
  :scope => "patterns",
7
7
  :title => "Patterns",
8
8
  :count => "#{patterns.length} #{Machinery.pluralize(patterns.length, "pattern")}"
9
+ - if @description.packages && @description.packages.package_system == "dpkg"
10
+ .row
11
+ .col-xs-1
12
+ .col-xs-11
13
+ Note: Tasks on Debian-like systems are treated as patterns.
9
14
  .row.scope_content.collapse.in
10
15
  .col-xs-1
11
16
  .col-xs-11
@@ -0,0 +1,49 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title
5
+ Machinery Error: incompatible system description
6
+ %meta{ :charset => 'utf-8' }
7
+ %link{ :href => "assets/machinery-base.css", :rel => "stylesheet", :type => "text/css" }
8
+ %link{ :href => "assets/machinery.css", :rel => "stylesheet", :type => "text/css" }
9
+ %script{ :src => "assets/jquery-2.1.1.min.js" }
10
+ %script{ :src => "assets/transition.js" }
11
+ %script{ :src => "assets/collapse.js" }
12
+ %script{ :src => "assets/modal.js" }
13
+ %script{ :src => "assets/jquery.searcher.min.js" }
14
+ %script{ :src => "assets/machinery-base.js" }
15
+ %script{ :src => "assets/show/machinery.js" }
16
+ %script{ :src => "assets/bootstrap-tooltip.js" }
17
+ %script{ :src => "assets/bootstrap-popover.js" }
18
+
19
+ %body
20
+ .container-fluid
21
+ #nav-bar
22
+ .row
23
+ .col-xs-1
24
+ .col-xs-10
25
+ %h1
26
+ System Description incompatible!
27
+ .row
28
+ .col-xs-1
29
+ .col-xs-4
30
+ Incompatible format version of system description
31
+ .col-xs-10.nav-buttons
32
+ %small.pull-right
33
+ created by
34
+ %a{ :href => "http://machinery-project.org", :target => "_blank" }
35
+ Machinery
36
+ %br
37
+ %a{ :href => "/site/docs/", :target => "_blank" }
38
+ Machinery documentation
39
+ #content_container
40
+ .row
41
+ .col-xs-11
42
+ - if @error
43
+ .scope#alert_container
44
+ .row
45
+ .col-xs-10.col-xs-offset-1
46
+ .well
47
+ %span
48
+ %p
49
+ = @error
@@ -23,23 +23,23 @@ class AnalyzeConfigFileDiffsTask
23
23
  description.validate_analysis_compatibility
24
24
  description.assert_scopes(
25
25
  "repositories",
26
- "config_files"
26
+ "changed_config_files"
27
27
  )
28
28
 
29
- if !description["repositories"].any? { |repo| repo.enabled && !repo.external_medium? }
29
+ unless description["repositories"].any? { |repo| repo.enabled && !repo.external_medium? }
30
30
  raise Machinery::Errors::AnalysisFailed,
31
31
  "Can not analyze the system description because it does not contain any online repository"
32
32
  end
33
33
 
34
- if !description.scope_extracted?("config_files")
35
- raise Machinery::Errors::MissingExtractedFiles.new(description, ["config_files"])
34
+ unless description.scope_extracted?("changed_config_files")
35
+ raise Machinery::Errors::MissingExtractedFiles.new(description, ["changed_config_files"])
36
36
  end
37
37
 
38
38
  with_repositories(description) do |zypper|
39
- file_store = description.scope_file_store("analyze/config_file_diffs")
39
+ file_store = description.scope_file_store("analyze/changed_config_files_diffs")
40
40
  file_store.create
41
41
  diffs_path = file_store.path
42
- extracted_files_path = description.scope_file_store("config_files").path
42
+ extracted_files_path = description.scope_file_store("changed_config_files").path
43
43
 
44
44
  Machinery::Ui.puts "Generating diffs..."
45
45
  cnt = 1
@@ -95,7 +95,7 @@ class AnalyzeConfigFileDiffsTask
95
95
  # }
96
96
  # ]
97
97
  def files_by_package(description)
98
- files = description["config_files"].
98
+ files = description["changed_config_files"].
99
99
  select { |f| f.changes.include?("md5") }
100
100
 
101
101
  files.inject({}) do |result, file|
@@ -137,7 +137,7 @@ class AnalyzeConfigFileDiffsTask
137
137
  raise if e.status.exitstatus == 7
138
138
 
139
139
  # Refreshing repositories might fail for various other reasons, but we
140
- # still stick to the plan because the relevant config files might be
140
+ # still stick to the plan because the relevant configuration files might be
141
141
  # available from the other repositories.
142
142
  # If they aren't an error message will then be generated for each of
143
143
  # the actually missing files instead.
data/lib/autoyast.rb CHANGED
@@ -24,11 +24,10 @@ class Autoyast < Exporter
24
24
  @system_description = description
25
25
  @system_description.assert_scopes(
26
26
  "os",
27
- "repositories",
28
27
  "packages"
29
28
  )
30
29
  check_exported_os
31
- if !description.users
30
+ unless description.users
32
31
  Machinery::Ui.puts(
33
32
  "\nWarning: Exporting a description without the scope 'users' as AutoYaST" \
34
33
  " profile will result in a root account without a password which prevents" \
@@ -85,7 +84,7 @@ class Autoyast < Exporter
85
84
  apply_groups(xml)
86
85
  apply_services(xml)
87
86
 
88
- apply_changed_files("config_files")
87
+ apply_changed_files("changed_config_files")
89
88
  apply_changed_files("changed_managed_files")
90
89
  apply_unmanaged_files
91
90
  xml.scripts do
@@ -138,7 +137,7 @@ class Autoyast < Exporter
138
137
  end
139
138
 
140
139
  def apply_repositories(xml)
141
- return if !@system_description.repositories
140
+ return unless @system_description.repositories
142
141
 
143
142
  xml.tag!("add-on") do
144
143
  xml.add_on_products("config:type" => "list") do
@@ -158,7 +157,7 @@ class Autoyast < Exporter
158
157
  if !repository.enabled || repository.external_medium?
159
158
  zypper_ar = "zypper -n ar --name='#{repository.name}'"
160
159
  zypper_ar << " --type='#{repository.type}'" if repository.type
161
- zypper_ar << " --disable" if !repository.enabled
160
+ zypper_ar << " --disable" unless repository.enabled
162
161
  zypper_ar << " '#{repository.url}' '#{repository.alias}'"
163
162
  @chroot_scripts << zypper_ar.strip
164
163
  end
@@ -175,7 +174,7 @@ class Autoyast < Exporter
175
174
  end
176
175
 
177
176
  def apply_packages(xml)
178
- return if !@system_description.packages
177
+ return unless @system_description.packages
179
178
 
180
179
  xml.packages("config:type" => "list") do
181
180
  @system_description.packages.each do |package|
@@ -185,7 +184,7 @@ class Autoyast < Exporter
185
184
  end
186
185
 
187
186
  def apply_patterns(xml)
188
- return if !@system_description.patterns
187
+ return unless @system_description.patterns
189
188
 
190
189
  xml.patterns("config:type" => "list") do
191
190
  @system_description.patterns.each do |pattern|
@@ -195,7 +194,7 @@ class Autoyast < Exporter
195
194
  end
196
195
 
197
196
  def apply_users(xml)
198
- return if !@system_description.users
197
+ return unless @system_description.users
199
198
 
200
199
  xml.users("config:type" => "list") do
201
200
  @system_description.users.each do |user|
@@ -221,7 +220,7 @@ class Autoyast < Exporter
221
220
  end
222
221
 
223
222
  def apply_groups(xml)
224
- return if !@system_description.groups
223
+ return unless @system_description.groups
225
224
 
226
225
  xml.groups("config:type" => "list") do
227
226
  @system_description.groups.each do |group|
@@ -237,7 +236,7 @@ class Autoyast < Exporter
237
236
  end
238
237
 
239
238
  def apply_services(xml)
240
- return if !@system_description.services
239
+ return unless @system_description.services
241
240
 
242
241
  xml.tag!("services-manager") do
243
242
  xml.services("config:type" => "list") do
@@ -245,7 +244,7 @@ class Autoyast < Exporter
245
244
  name = service.name
246
245
  if @system_description.services.init_system == "systemd"
247
246
  # Yast can only handle services right now
248
- next if !(name =~ /\.service$/)
247
+ next unless name =~ /\.service$/
249
248
  name = name.gsub(/\.service$/, "")
250
249
  end
251
250
  # systemd service states like "masked" and "static" are
@@ -279,7 +278,7 @@ class Autoyast < Exporter
279
278
  end
280
279
 
281
280
  def apply_changed_files(scope)
282
- return if !@system_description.scope_extracted?(scope)
281
+ return unless @system_description.scope_extracted?(scope)
283
282
 
284
283
  @system_description[scope].each do |file|
285
284
  if file.deleted?
@@ -308,7 +307,7 @@ EOF
308
307
  end
309
308
 
310
309
  def apply_unmanaged_files
311
- return if !@system_description.scope_extracted?("unmanaged_files")
310
+ return unless @system_description.scope_extracted?("unmanaged_files")
312
311
 
313
312
  base = Pathname(@system_description.scope_file_store("unmanaged_files").path)
314
313
  @chroot_scripts << <<-EOF.chomp.gsub(/^\s+/, "")
data/lib/build_task.rb CHANGED
@@ -68,7 +68,7 @@ class BuildTask
68
68
 
69
69
  Machinery::Ui.warn "Cleaning up temporary files..."
70
70
  [tmp_config_dir, tmp_image_dir].each do |path|
71
- LoggedCheetah.run("sudo", "rm", "-r", path) if Dir.exists?(path)
71
+ LoggedCheetah.run("sudo", "rm", "-r", path) if Dir.exist?(path)
72
72
  end
73
73
  end
74
74
  raise
@@ -89,7 +89,7 @@ class BuildTask
89
89
 
90
90
  image_file = Dir.glob(File.join(output_path, "*.#{img_extension}")).first
91
91
 
92
- if !image_file
92
+ unless image_file
93
93
  raise(Machinery::Errors::BuildFailed, "The image build process failed. Check " \
94
94
  "build log '#{tmp_image_dir}/kiwi-terminal-output.log' for more " \
95
95
  "details."