machinery-tool 1.14.2 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/.git_revision +1 -1
  3. data/NEWS +14 -0
  4. data/html/assets/compare/machinery.js +20 -13
  5. data/html/assets/file_loader.gif +0 -0
  6. data/html/assets/machinery-base.css +21 -12
  7. data/html/assets/machinery-base.js +19 -0
  8. data/html/assets/machinery.css +35 -11
  9. data/html/assets/show/machinery.js +24 -7
  10. data/html/comparison.html.haml +13 -36
  11. data/html/index.html.haml +32 -47
  12. data/html/partials/changed_managed_files.html.haml +5 -5
  13. data/html/partials/compare/changed_managed_file_list.html.haml +1 -1
  14. data/html/partials/compare/changed_managed_files.html.haml +41 -47
  15. data/html/partials/compare/changes.html.haml +8 -0
  16. data/html/partials/compare/config_file_list.html.haml +5 -5
  17. data/html/partials/compare/config_files.html.haml +38 -44
  18. data/html/partials/compare/group_list.html.haml +3 -3
  19. data/html/partials/compare/groups.html.haml +34 -42
  20. data/html/partials/compare/os.html.haml +21 -23
  21. data/html/partials/compare/package_list.html.haml +2 -2
  22. data/html/partials/compare/packages.html.haml +40 -56
  23. data/html/partials/compare/pattern_list.html.haml +2 -2
  24. data/html/partials/compare/patterns.html.haml +40 -42
  25. data/html/partials/compare/repositories.html.haml +40 -41
  26. data/html/partials/compare/service_list.html.haml +1 -1
  27. data/html/partials/compare/services.html.haml +44 -36
  28. data/html/partials/compare/summary.html.haml +17 -0
  29. data/html/partials/compare/unmanaged_file_list.html.haml +4 -3
  30. data/html/partials/compare/unmanaged_files.html.haml +44 -38
  31. data/html/partials/compare/user_list.html.haml +2 -2
  32. data/html/partials/compare/users.html.haml +40 -43
  33. data/html/partials/config_files.html.haml +8 -8
  34. data/html/partials/os.html.haml +8 -5
  35. data/html/partials/packages.html.haml +4 -4
  36. data/html/partials/patterns.html.haml +2 -2
  37. data/html/partials/repositories.html.haml +5 -5
  38. data/html/partials/scope_header.html.haml +4 -6
  39. data/html/partials/services.html.haml +1 -1
  40. data/html/partials/unmanaged_files.html.haml +1 -1
  41. data/html/partials/users.html.haml +4 -4
  42. data/lib/array.rb +4 -0
  43. data/lib/cli.rb +12 -4
  44. data/lib/file_scope.rb +9 -3
  45. data/lib/html.rb +1 -0
  46. data/lib/machinery.rb +1 -0
  47. data/lib/scope.rb +16 -0
  48. data/lib/server.rb +61 -23
  49. data/lib/system_description.rb +0 -8
  50. data/lib/try.rb +28 -0
  51. data/lib/version.rb +1 -1
  52. data/machinery-helper/version.go +1 -1
  53. data/man/generated/machinery.1.gz +0 -0
  54. data/man/generated/machinery.1.html +54 -22
  55. data/plugins/changed_managed_files/{changed_managed_files.md → changed_managed_files.yml} +4 -0
  56. data/plugins/changed_managed_files/changed_managed_files_model.rb +14 -0
  57. data/plugins/changed_managed_files/changed_managed_files_renderer.rb +17 -0
  58. data/plugins/config_files/{config_files.md → config_files.yml} +4 -0
  59. data/plugins/config_files/config_files_model.rb +14 -0
  60. data/plugins/config_files/config_files_renderer.rb +17 -0
  61. data/plugins/groups/{groups.md → groups.yml} +4 -0
  62. data/plugins/groups/groups_model.rb +14 -0
  63. data/plugins/groups/groups_renderer.rb +17 -0
  64. data/plugins/os/{os.md → os.yml} +4 -0
  65. data/plugins/packages/{packages.md → packages.yml} +4 -0
  66. data/plugins/packages/packages_model.rb +1 -12
  67. data/plugins/patterns/{patterns.md → patterns.yml} +4 -0
  68. data/plugins/patterns/patterns_model.rb +14 -0
  69. data/plugins/patterns/patterns_renderer.rb +21 -0
  70. data/plugins/repositories/{repositories.md → repositories.yml} +4 -0
  71. data/plugins/repositories/repositories_model.rb +14 -0
  72. data/plugins/repositories/repositories_renderer.rb +17 -0
  73. data/plugins/services/{services.md → services.yml} +4 -0
  74. data/plugins/services/services_model.rb +21 -11
  75. data/plugins/services/services_renderer.rb +17 -0
  76. data/plugins/unmanaged_files/{unmanaged_files.md → unmanaged_files.yml} +4 -0
  77. data/plugins/unmanaged_files/unmanaged_files_model.rb +2 -1
  78. data/plugins/unmanaged_files/unmanaged_files_renderer.rb +17 -0
  79. data/plugins/users/{users.md → users.yml} +4 -0
  80. data/plugins/users/users_model.rb +38 -0
  81. data/plugins/users/users_renderer.rb +17 -0
  82. metadata +17 -32
  83. data/html/assets/logo-changed-managed-files-small.png +0 -0
  84. data/html/assets/logo-changed-managed-files.png +0 -0
  85. data/html/assets/logo-config-files-small.png +0 -0
  86. data/html/assets/logo-config-files.png +0 -0
  87. data/html/assets/logo-groups-small.png +0 -0
  88. data/html/assets/logo-groups.png +0 -0
  89. data/html/assets/logo-os-small.png +0 -0
  90. data/html/assets/logo-os.png +0 -0
  91. data/html/assets/logo-packages-small.png +0 -0
  92. data/html/assets/logo-packages.png +0 -0
  93. data/html/assets/logo-patterns-small.png +0 -0
  94. data/html/assets/logo-patterns.png +0 -0
  95. data/html/assets/logo-repositories-small.png +0 -0
  96. data/html/assets/logo-repositories.png +0 -0
  97. data/html/assets/logo-services-small.png +0 -0
  98. data/html/assets/logo-services.png +0 -0
  99. data/html/assets/logo-unmanaged-files-small.png +0 -0
  100. data/html/assets/logo-unmanaged-files.png +0 -0
  101. data/html/assets/logo-users-small.png +0 -0
  102. data/html/assets/logo-users.png +0 -0
@@ -1,3 +1,7 @@
1
+ ---
2
+ :name: Repositories
3
+ :initials: r
4
+ :description: |
1
5
  Contains all information about software repositories configured on the
2
6
  inspected system. The information about repositories depends on the package
3
7
  manager of the distribution. Thus on SUSE-based systems the `zypper` command
@@ -26,4 +26,18 @@ class RepositoriesScope < Machinery::Array
26
26
  include Machinery::Scope
27
27
 
28
28
  has_elements class: Repository
29
+
30
+ def compare_with(other)
31
+ only_self = self - other
32
+ only_other = other - self
33
+ common = self & other
34
+ changed = Machinery::Scope.extract_changed_elements(only_self, only_other, :alias)
35
+
36
+ [
37
+ only_self,
38
+ only_other,
39
+ changed,
40
+ common
41
+ ].map { |e| (e && !e.empty?) ? e : nil }
42
+ end
29
43
  end
@@ -40,4 +40,21 @@ class RepositoriesRenderer < Renderer
40
40
  def display_name
41
41
  "Repositories"
42
42
  end
43
+
44
+ def compare_content_changed(changed_elements)
45
+ list do
46
+ changed_elements.each do |one, two|
47
+ changes = []
48
+ relevant_attributes = one.attributes.keys
49
+
50
+ relevant_attributes.each do |attribute|
51
+ if one[attribute] != two[attribute]
52
+ changes << "#{attribute}: #{one[attribute]} <> #{two[attribute]}"
53
+ end
54
+ end
55
+
56
+ item "#{one.alias} (#{changes.join(", ")})"
57
+ end
58
+ end
59
+ end
43
60
  end
@@ -1,3 +1,7 @@
1
+ ---
2
+ :name: Services
3
+ :initials: s
4
+ :description: |
1
5
  Services are applications running in the background doing continuous work
2
6
  or waiting for requests to do work.
3
7
  The scope determines which services are configured to be started in which
@@ -40,18 +40,28 @@ class ServicesScope < Machinery::Object
40
40
  if self.init_system != other.init_system
41
41
  [self, other, nil, nil]
42
42
  else
43
+ only_self = self.services - other.services
44
+ only_other = other.services - self.services
45
+ common = self.services & other.services
46
+ changed = Machinery::Scope.extract_changed_elements(only_self, only_other, :name)
47
+ changed = nil if changed.empty?
48
+
43
49
  [
44
- self.services - other.services,
45
- other.services - self.services,
46
- [],
47
- self.services & other.services
48
- ].map do |services|
49
- if !services.empty?
50
- self.class.new(:init_system => self.init_system, :services => services)
51
- else
52
- nil
53
- end
54
- end
50
+ service_list_to_scope(only_self),
51
+ service_list_to_scope(only_other),
52
+ changed,
53
+ service_list_to_scope(common)
54
+ ]
55
55
  end
56
56
  end
57
+
58
+ def length
59
+ services.try(:length) || 0
60
+ end
61
+
62
+ private
63
+
64
+ def service_list_to_scope(services)
65
+ self.class.new(init_system: init_system, services: services) if !services.empty?
66
+ end
57
67
  end
@@ -29,4 +29,21 @@ class ServicesRenderer < Renderer
29
29
  def display_name
30
30
  "Services"
31
31
  end
32
+
33
+ def compare_content_changed(changed_elements)
34
+ list do
35
+ changed_elements.each do |one, two|
36
+ changes = []
37
+ relevant_attributes = one.attributes.keys
38
+
39
+ relevant_attributes.each do |attribute|
40
+ if one[attribute] != two[attribute]
41
+ changes << "#{attribute}: #{one[attribute]} <> #{two[attribute]}"
42
+ end
43
+ end
44
+
45
+ item "#{one.name} (#{changes.join(", ")})"
46
+ end
47
+ end
48
+ end
32
49
  end
@@ -1,3 +1,7 @@
1
+ ---
2
+ :name: Unmanaged Files
3
+ :initials: uf
4
+ :description: |
1
5
  Contains the names and contents of all files which are not part of any RPM
2
6
  package. The list of unmanaged files contains only plain files and
3
7
  directories. Special files like device nodes, named pipes and Unix domain
@@ -37,11 +37,12 @@ class UnmanagedFileList < Machinery::Array
37
37
  only_other = other.elements.reject do |element|
38
38
  self_hash.has_key?(element.name) && files_match(element, self_hash[element.name])
39
39
  end
40
+ changed = Machinery::Scope.extract_changed_elements(only_self, only_other, :name)
40
41
 
41
42
  [
42
43
  self.class.new(only_self),
43
44
  self.class.new(only_other),
44
- [],
45
+ changed,
45
46
  self.class.new(both)
46
47
  ].map { |e| e.empty? ? nil : e }
47
48
  end
@@ -45,4 +45,21 @@ class UnmanagedFilesRenderer < Renderer
45
45
  def display_name
46
46
  "Unmanaged files"
47
47
  end
48
+
49
+ def compare_content_changed(changed_elements)
50
+ list do
51
+ changed_elements.each do |one, two|
52
+ changes = []
53
+ relevant_attributes = (one.attributes.keys & two.attributes.keys)
54
+
55
+ relevant_attributes.each do |attribute|
56
+ if one[attribute] != two[attribute]
57
+ changes << "#{attribute}: #{one[attribute]} <> #{two[attribute]}"
58
+ end
59
+ end
60
+
61
+ item "#{one.name} (#{changes.join(", ")})"
62
+ end
63
+ end
64
+ end
48
65
  end
@@ -1,3 +1,7 @@
1
+ ---
2
+ :name: Users
3
+ :initials: u
4
+ :description: |
1
5
  Contains information about the system users including user and group ids,
2
6
  login information, such as password hashes and - if available - additional
3
7
  password properties.
@@ -17,10 +17,48 @@
17
17
 
18
18
 
19
19
  class User < Machinery::Object
20
+ IGNORED_ATTRIBUTES_IN_COMPARISON = [
21
+ "password",
22
+ "encrypted_password",
23
+ "last_changed_date",
24
+ "min_days",
25
+ "max_days",
26
+ "warn_days"
27
+ ]
28
+
29
+ # User objects contain some information which is not relevant in the context of comparison (e.g.
30
+ # metadata like "last_changed_date"). In order to ignore these attributes during comparison we
31
+ # have to overwrite some methods.
32
+ def eql?(other)
33
+ relevant_attributes = (attributes.keys & other.attributes.keys) -
34
+ IGNORED_ATTRIBUTES_IN_COMPARISON
35
+
36
+ relevant_attributes.all? do |attribute|
37
+ self[attribute] == other[attribute]
38
+ end
39
+ end
40
+
41
+ def hash
42
+ @attributes.reject { |k, _v| IGNORED_ATTRIBUTES_IN_COMPARISON.include?(k) }.hash
43
+ end
20
44
  end
21
45
 
22
46
  class UsersScope < Machinery::Array
23
47
  include Machinery::Scope
24
48
 
25
49
  has_elements class: User
50
+
51
+ def compare_with(other)
52
+ only_self = self - other
53
+ only_other = other - self
54
+ common = self & other
55
+ changed = Machinery::Scope.extract_changed_elements(only_self, only_other, :name)
56
+
57
+ [
58
+ only_self,
59
+ only_other,
60
+ changed,
61
+ common
62
+ ].map { |e| (e && !e.empty?) ? e : nil }
63
+ end
26
64
  end
@@ -32,4 +32,21 @@ class UsersRenderer < Renderer
32
32
  def display_name
33
33
  "Users"
34
34
  end
35
+
36
+ def compare_content_changed(changed_elements)
37
+ list do
38
+ changed_elements.each do |one, two|
39
+ changes = []
40
+ relevant_attributes = ["uid", "gid", "comment", "shell", "home"]
41
+
42
+ relevant_attributes.each do |attribute|
43
+ if one[attribute] != two[attribute]
44
+ changes << "#{attribute}: #{one[attribute]} <> #{two[attribute]}"
45
+ end
46
+ end
47
+
48
+ item "#{one.name} (#{changes.join(", ")})"
49
+ end
50
+ end
51
+ end
35
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: machinery-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.2
4
+ version: 1.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SUSE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-14 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cheetah
@@ -251,29 +251,11 @@ files:
251
251
  - html/assets/collapse.js
252
252
  - html/assets/compare/machinery.js
253
253
  - html/assets/cross.png
254
+ - html/assets/file_loader.gif
254
255
  - html/assets/jquery-2.1.1.min.js
255
256
  - html/assets/jquery.searcher.min.js
256
- - html/assets/logo-changed-managed-files-small.png
257
- - html/assets/logo-changed-managed-files.png
258
- - html/assets/logo-config-files-small.png
259
- - html/assets/logo-config-files.png
260
- - html/assets/logo-groups-small.png
261
- - html/assets/logo-groups.png
262
- - html/assets/logo-os-small.png
263
- - html/assets/logo-os.png
264
- - html/assets/logo-packages-small.png
265
- - html/assets/logo-packages.png
266
- - html/assets/logo-patterns-small.png
267
- - html/assets/logo-patterns.png
268
- - html/assets/logo-repositories-small.png
269
- - html/assets/logo-repositories.png
270
- - html/assets/logo-services-small.png
271
- - html/assets/logo-services.png
272
- - html/assets/logo-unmanaged-files-small.png
273
- - html/assets/logo-unmanaged-files.png
274
- - html/assets/logo-users-small.png
275
- - html/assets/logo-users.png
276
257
  - html/assets/machinery-base.css
258
+ - html/assets/machinery-base.js
277
259
  - html/assets/machinery.css
278
260
  - html/assets/modal.js
279
261
  - html/assets/reset.png
@@ -286,6 +268,7 @@ files:
286
268
  - html/partials/compare/alert.html.haml
287
269
  - html/partials/compare/changed_managed_file_list.html.haml
288
270
  - html/partials/compare/changed_managed_files.html.haml
271
+ - html/partials/compare/changes.html.haml
289
272
  - html/partials/compare/config_file_list.html.haml
290
273
  - html/partials/compare/config_files.html.haml
291
274
  - html/partials/compare/group_list.html.haml
@@ -300,6 +283,7 @@ files:
300
283
  - html/partials/compare/repository_list.html.haml
301
284
  - html/partials/compare/service_list.html.haml
302
285
  - html/partials/compare/services.html.haml
286
+ - html/partials/compare/summary.html.haml
303
287
  - html/partials/compare/unmanaged_file_list.html.haml
304
288
  - html/partials/compare/unmanaged_files.html.haml
305
289
  - html/partials/compare/user_list.html.haml
@@ -381,6 +365,7 @@ files:
381
365
  - lib/system_description_store.rb
382
366
  - lib/system_file.rb
383
367
  - lib/tarball.rb
368
+ - lib/try.rb
384
369
  - lib/ui.rb
385
370
  - lib/upgrade_format_task.rb
386
371
  - lib/validate_task.rb
@@ -398,7 +383,7 @@ files:
398
383
  - machinery-helper/version.go
399
384
  - man/generated/machinery.1.gz
400
385
  - man/generated/machinery.1.html
401
- - plugins/changed_managed_files/changed_managed_files.md
386
+ - plugins/changed_managed_files/changed_managed_files.yml
402
387
  - plugins/changed_managed_files/changed_managed_files_inspector.rb
403
388
  - plugins/changed_managed_files/changed_managed_files_model.rb
404
389
  - plugins/changed_managed_files/changed_managed_files_renderer.rb
@@ -407,7 +392,7 @@ files:
407
392
  - plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v3.json
408
393
  - plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v4.json
409
394
  - plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v5.json
410
- - plugins/config_files/config_files.md
395
+ - plugins/config_files/config_files.yml
411
396
  - plugins/config_files/config_files_inspector.rb
412
397
  - plugins/config_files/config_files_model.rb
413
398
  - plugins/config_files/config_files_renderer.rb
@@ -420,7 +405,7 @@ files:
420
405
  - plugins/environment/environment_inspector.rb
421
406
  - plugins/environment/environment_model.rb
422
407
  - plugins/environment/schema/system-description-environment.schema-v5.json
423
- - plugins/groups/groups.md
408
+ - plugins/groups/groups.yml
424
409
  - plugins/groups/groups_inspector.rb
425
410
  - plugins/groups/groups_model.rb
426
411
  - plugins/groups/groups_renderer.rb
@@ -429,7 +414,7 @@ files:
429
414
  - plugins/groups/schema/system-description-groups.schema-v3.json
430
415
  - plugins/groups/schema/system-description-groups.schema-v4.json
431
416
  - plugins/groups/schema/system-description-groups.schema-v5.json
432
- - plugins/os/os.md
417
+ - plugins/os/os.yml
433
418
  - plugins/os/os_inspector.rb
434
419
  - plugins/os/os_model.rb
435
420
  - plugins/os/os_renderer.rb
@@ -438,7 +423,7 @@ files:
438
423
  - plugins/os/schema/system-description-os.schema-v3.json
439
424
  - plugins/os/schema/system-description-os.schema-v4.json
440
425
  - plugins/os/schema/system-description-os.schema-v5.json
441
- - plugins/packages/packages.md
426
+ - plugins/packages/packages.yml
442
427
  - plugins/packages/packages_inspector.rb
443
428
  - plugins/packages/packages_model.rb
444
429
  - plugins/packages/packages_renderer.rb
@@ -447,7 +432,7 @@ files:
447
432
  - plugins/packages/schema/system-description-packages.schema-v3.json
448
433
  - plugins/packages/schema/system-description-packages.schema-v4.json
449
434
  - plugins/packages/schema/system-description-packages.schema-v5.json
450
- - plugins/patterns/patterns.md
435
+ - plugins/patterns/patterns.yml
451
436
  - plugins/patterns/patterns_inspector.rb
452
437
  - plugins/patterns/patterns_model.rb
453
438
  - plugins/patterns/patterns_renderer.rb
@@ -456,7 +441,7 @@ files:
456
441
  - plugins/patterns/schema/system-description-patterns.schema-v3.json
457
442
  - plugins/patterns/schema/system-description-patterns.schema-v4.json
458
443
  - plugins/patterns/schema/system-description-patterns.schema-v5.json
459
- - plugins/repositories/repositories.md
444
+ - plugins/repositories/repositories.yml
460
445
  - plugins/repositories/repositories_inspector.rb
461
446
  - plugins/repositories/repositories_model.rb
462
447
  - plugins/repositories/repositories_renderer.rb
@@ -470,7 +455,7 @@ files:
470
455
  - plugins/services/schema/system-description-services.schema-v3.json
471
456
  - plugins/services/schema/system-description-services.schema-v4.json
472
457
  - plugins/services/schema/system-description-services.schema-v5.json
473
- - plugins/services/services.md
458
+ - plugins/services/services.yml
474
459
  - plugins/services/services_inspector.rb
475
460
  - plugins/services/services_model.rb
476
461
  - plugins/services/services_renderer.rb
@@ -479,7 +464,7 @@ files:
479
464
  - plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v3.json
480
465
  - plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v4.json
481
466
  - plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v5.json
482
- - plugins/unmanaged_files/unmanaged_files.md
467
+ - plugins/unmanaged_files/unmanaged_files.yml
483
468
  - plugins/unmanaged_files/unmanaged_files_inspector.rb
484
469
  - plugins/unmanaged_files/unmanaged_files_model.rb
485
470
  - plugins/unmanaged_files/unmanaged_files_renderer.rb
@@ -488,7 +473,7 @@ files:
488
473
  - plugins/users/schema/system-description-users.schema-v3.json
489
474
  - plugins/users/schema/system-description-users.schema-v4.json
490
475
  - plugins/users/schema/system-description-users.schema-v5.json
491
- - plugins/users/users.md
476
+ - plugins/users/users.yml
492
477
  - plugins/users/users_inspector.rb
493
478
  - plugins/users/users_model.rb
494
479
  - plugins/users/users_renderer.rb
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file