machinery-tool 1.20.0 → 1.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.git_revision +1 -1
  3. data/NEWS +12 -0
  4. data/html/assets/bootstrap-modal.js +338 -0
  5. data/html/assets/compare/machinery.js +15 -0
  6. data/html/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  7. data/html/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  8. data/html/assets/machinery-base.css +5 -2
  9. data/html/assets/machinery-base.js +16 -1
  10. data/html/assets/machinery.css +41 -0
  11. data/html/assets/show/machinery.js +18 -0
  12. data/html/comparison.html.haml +25 -26
  13. data/html/homepage.html.haml +24 -0
  14. data/html/index.html.haml +35 -30
  15. data/html/partials/{landing_page/alert.html.haml → alert.html.haml} +0 -0
  16. data/html/partials/compare/changed_config_files.html.haml +1 -1
  17. data/html/partials/compare/changed_managed_files.html.haml +1 -1
  18. data/html/partials/compare/groups.html.haml +1 -1
  19. data/html/partials/compare/os.html.haml +1 -1
  20. data/html/partials/compare/packages.html.haml +1 -1
  21. data/html/partials/compare/pattern_list.html.haml +3 -0
  22. data/html/partials/compare/patterns.html.haml +1 -2
  23. data/html/partials/compare/repositories.html.haml +1 -1
  24. data/html/partials/compare/services.html.haml +1 -1
  25. data/html/partials/compare/unmanaged_file_list.html.haml +12 -4
  26. data/html/partials/compare/unmanaged_files.html.haml +1 -1
  27. data/html/partials/compare/users.html.haml +1 -1
  28. data/html/partials/description_selector.html.haml +57 -0
  29. data/html/partials/nav_bar.html.haml +34 -0
  30. data/html/partials/patterns.html.haml +4 -1
  31. data/html/partials/unmanaged_files.html.haml +11 -3
  32. data/lib/config_task.rb +8 -2
  33. data/lib/exceptions.rb +0 -1
  34. data/lib/server.rb +19 -2
  35. data/lib/system_description.rb +1 -1
  36. data/lib/version.rb +1 -1
  37. data/lib/zypper.rb +1 -1
  38. data/machinery-helper/machinery_helper.go +12 -4
  39. data/machinery-helper/machinery_helper_test.go +5 -1
  40. data/machinery-helper/version.go +1 -1
  41. data/man/generated/machinery.1.gz +0 -0
  42. data/manual/site/sitemap.xml +23 -23
  43. data/plugins/changed_config_files/schema/system-description-changed-config-files.schema-v10.json +160 -0
  44. data/plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v10.json +160 -0
  45. data/plugins/environment/schema/system-description-environment.schema-v10.json +17 -0
  46. data/plugins/groups/schema/system-description-groups.schema-v10.json +49 -0
  47. data/plugins/os/schema/system-description-os.schema-v10.json +21 -0
  48. data/plugins/packages/schema/system-description-packages.schema-v10.json +115 -0
  49. data/plugins/patterns/patterns_inspector.rb +2 -0
  50. data/plugins/patterns/patterns_model.rb +1 -0
  51. data/plugins/patterns/patterns_renderer.rb +4 -1
  52. data/plugins/patterns/schema/system-description-patterns.schema-v10.json +69 -0
  53. data/plugins/repositories/schema/system-description-repositories.schema-v10.json +165 -0
  54. data/plugins/services/schema/system-description-services.schema-v10.json +93 -0
  55. data/plugins/services/services_inspector.rb +40 -9
  56. data/plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v10.json +153 -0
  57. data/plugins/unmanaged_files/unmanaged_files_model.rb +8 -0
  58. data/plugins/unmanaged_files/unmanaged_files_renderer.rb +8 -2
  59. data/plugins/users/schema/system-description-users.schema-v10.json +86 -0
  60. data/schema/migrations/migrate9to10.rb +55 -0
  61. data/schema/system-description-global.schema-v10.json +43 -0
  62. metadata +23 -5
  63. data/html/landing_page.html.haml +0 -62
@@ -73,6 +73,14 @@ class UnmanagedFilesScope < FileScope
73
73
  comparison.push(common)
74
74
  end
75
75
 
76
+ def contains_metadata?
77
+ @metadata ||= has_metadata || elements.any?(&:user)
78
+ end
79
+
80
+ def has_subdir_counts?
81
+ @has_subdirs ||= elements.any?(&:files)
82
+ end
83
+
76
84
  private
77
85
 
78
86
  def files_match(a, b)
@@ -30,12 +30,18 @@ class UnmanagedFilesRenderer < Renderer
30
30
 
31
31
  if description["unmanaged_files"]
32
32
  description["unmanaged_files"].each do |p|
33
- if description["unmanaged_files"].has_metadata
33
+ if description["unmanaged_files"].contains_metadata?
34
34
  item "#{p.name} (#{p.type})" do
35
35
  puts "User/Group: #{p.user}:#{p.group}" if p.user || p.group
36
36
  puts "Mode: #{p.mode}" if p.mode
37
37
  puts "Size: #{number_to_human_size(p.size)}" if p.size
38
- puts "Files: #{p.files}" if p.files
38
+ if p.files && p.dirs
39
+ puts "Files: #{p.files}"
40
+ puts "Subdirectories: #{p.dirs}"
41
+ end
42
+ if p.file_objects
43
+ puts "File Objects: #{p.file_objects}"
44
+ end
39
45
  end
40
46
  else
41
47
  item "#{p.name} (#{p.type})"
@@ -0,0 +1,86 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "object",
5
+ "required": [
6
+ "_elements"
7
+ ],
8
+ "properties": {
9
+ "_attributes": {
10
+ "type": "object"
11
+ },
12
+ "_elements": {
13
+ "type": "array",
14
+ "items": {
15
+ "type": "object",
16
+ "required": [
17
+ "name",
18
+ "password",
19
+ "uid",
20
+ "gid",
21
+ "comment",
22
+ "home",
23
+ "shell"
24
+ ],
25
+ "properties": {
26
+ "name": {
27
+ "type": "string",
28
+ "minLength": 1
29
+ },
30
+ "password": {
31
+ "type": "string"
32
+ },
33
+ "uid": {
34
+ "type": [
35
+ "integer",
36
+ "null"
37
+ ],
38
+ "minimum": 0
39
+ },
40
+ "gid": {
41
+ "type": [
42
+ "integer",
43
+ "null"
44
+ ],
45
+ "minimum": 0
46
+ },
47
+ "comment": {
48
+ "type": "string"
49
+ },
50
+ "home": {
51
+ "type": "string"
52
+ },
53
+ "shell": {
54
+ "type": "string"
55
+ },
56
+ "encrypted_password": {
57
+ "type": "string"
58
+ },
59
+ "last_changed_date": {
60
+ "type": "integer"
61
+ },
62
+ "min_days": {
63
+ "type": "integer",
64
+ "minimum": 0
65
+ },
66
+ "max_days": {
67
+ "type": "integer",
68
+ "minimum": 0
69
+ },
70
+ "warn_days": {
71
+ "type": "integer",
72
+ "minimum": 0
73
+ },
74
+ "disable_days": {
75
+ "type": "integer",
76
+ "minimum": 0
77
+ },
78
+ "disabled_date": {
79
+ "type": "integer"
80
+ }
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+
@@ -0,0 +1,55 @@
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
+ #
3
+ # This program is free software; you can redistribute it and/or
4
+ # modify it under the terms of version 3 of the GNU General Public License as
5
+ # published by the Free Software Foundation.
6
+ #
7
+ # This program is distributed in the hope that it will be useful,
8
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
9
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
+ # GNU General Public License for more details.
11
+ #
12
+ # You should have received a copy of the GNU General Public License
13
+ # along with this program; if not, contact SUSE LLC.
14
+ #
15
+ # To contact SUSE about this file by physical or electronic mail,
16
+ # you may find current contact information at www.suse.com
17
+
18
+ class Migrate9To10 < Migration
19
+ desc <<-EOT
20
+ Add meta data information regarding subdirectories to unmanaged files. The subdirectory
21
+ count is not available for migrated descriptions so the sum of both is called file_objects.
22
+ Add an attribute to the patterns scope which identifies pattern management on the inspected
23
+ system (tasksel on Debian, zypper on SUSE).
24
+ EOT
25
+
26
+ def migrate
27
+ if @hash.key?("unmanaged_files")
28
+ @hash["unmanaged_files"]["_elements"].each do |element|
29
+ if element["type"] == "dir" && element["files"]
30
+ element["file_objects"] = element.delete("files")
31
+ end
32
+ end
33
+ end
34
+
35
+ if @hash.key?("patterns")
36
+ if @hash.key?("packages")
37
+ patterns_system = if @hash["packages"]["_attributes"]["package_system"] == "dpkg"
38
+ "tasksel"
39
+ else
40
+ "zypper"
41
+ end
42
+ else
43
+ patterns_system = "zypper"
44
+ Machinery::Ui.warn("No packages scope found. Patterns system defaults to zypper.")
45
+ end
46
+
47
+ @hash["patterns"] = {
48
+ "_attributes" => {
49
+ "patterns_system" => patterns_system
50
+ },
51
+ "_elements" => @hash["patterns"]["_elements"]
52
+ }
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+
4
+ "type": "object",
5
+ "required": ["meta"],
6
+ "properties": {
7
+ "meta": {
8
+ "required": ["format_version"],
9
+ "properties": {
10
+ "format_version": {
11
+ "type": "integer",
12
+ "minimum": 1
13
+ },
14
+ "filters": {
15
+ "type": "object",
16
+ "required": ["inspect"],
17
+ "properties": {
18
+ "inspect": {
19
+ "type": "array",
20
+ "items": {
21
+ "type": "string"
22
+ }
23
+ }
24
+ }
25
+ }
26
+ },
27
+ "additionalProperties": {
28
+ "type": "object",
29
+ "required": ["modified", "hostname"],
30
+ "properties": {
31
+ "modified": {
32
+ "type": "string",
33
+ "format": "date-time"
34
+ },
35
+ "hostname": {
36
+ "type": "string",
37
+ "format": "hostname"
38
+ }
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
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.20.0
4
+ version: 1.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SUSE
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-22 00:00:00.000000000 Z
11
+ date: 2016-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cheetah
@@ -245,6 +245,7 @@ files:
245
245
  - filters/filter-packages-for-build.yaml
246
246
  - html/assets/arrow_down.png
247
247
  - html/assets/arrow_up.png
248
+ - html/assets/bootstrap-modal.js
248
249
  - html/assets/bootstrap-popover.js
249
250
  - html/assets/bootstrap-tooltip.js
250
251
  - html/assets/bootstrap.min.css
@@ -252,6 +253,8 @@ files:
252
253
  - html/assets/compare/machinery.js
253
254
  - html/assets/cross.png
254
255
  - html/assets/file_loader.gif
256
+ - html/assets/fonts/glyphicons-halflings-regular.ttf
257
+ - html/assets/fonts/glyphicons-halflings-regular.woff
255
258
  - html/assets/jquery-2.1.1.min.js
256
259
  - html/assets/jquery.searcher.min.js
257
260
  - html/assets/machinery-base.css
@@ -264,8 +267,9 @@ files:
264
267
  - html/assets/wheels_horizontal.png
265
268
  - html/comparison.html.haml
266
269
  - html/exception.html.haml
270
+ - html/homepage.html.haml
267
271
  - html/index.html.haml
268
- - html/landing_page.html.haml
272
+ - html/partials/alert.html.haml
269
273
  - html/partials/changed_config_files.html.haml
270
274
  - html/partials/changed_managed_files.html.haml
271
275
  - html/partials/compare/alert.html.haml
@@ -293,8 +297,9 @@ files:
293
297
  - html/partials/compare/unmanaged_files.html.haml
294
298
  - html/partials/compare/user_list.html.haml
295
299
  - html/partials/compare/users.html.haml
300
+ - html/partials/description_selector.html.haml
296
301
  - html/partials/groups.html.haml
297
- - html/partials/landing_page/alert.html.haml
302
+ - html/partials/nav_bar.html.haml
298
303
  - html/partials/os.html.haml
299
304
  - html/partials/packages.html.haml
300
305
  - html/partials/patterns.html.haml
@@ -561,6 +566,7 @@ files:
561
566
  - plugins/changed_config_files/changed_config_files_model.rb
562
567
  - plugins/changed_config_files/changed_config_files_renderer.rb
563
568
  - plugins/changed_config_files/schema/system-description-changed-config-files.schema-v1.json
569
+ - plugins/changed_config_files/schema/system-description-changed-config-files.schema-v10.json
564
570
  - plugins/changed_config_files/schema/system-description-changed-config-files.schema-v2.json
565
571
  - plugins/changed_config_files/schema/system-description-changed-config-files.schema-v3.json
566
572
  - plugins/changed_config_files/schema/system-description-changed-config-files.schema-v4.json
@@ -574,6 +580,7 @@ files:
574
580
  - plugins/changed_managed_files/changed_managed_files_model.rb
575
581
  - plugins/changed_managed_files/changed_managed_files_renderer.rb
576
582
  - plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v1.json
583
+ - plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v10.json
577
584
  - plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v2.json
578
585
  - plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v3.json
579
586
  - plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v4.json
@@ -585,6 +592,7 @@ files:
585
592
  - plugins/environment/environment.md
586
593
  - plugins/environment/environment_inspector.rb
587
594
  - plugins/environment/environment_model.rb
595
+ - plugins/environment/schema/system-description-environment.schema-v10.json
588
596
  - plugins/environment/schema/system-description-environment.schema-v5.json
589
597
  - plugins/environment/schema/system-description-environment.schema-v6.json
590
598
  - plugins/environment/schema/system-description-environment.schema-v7.json
@@ -595,6 +603,7 @@ files:
595
603
  - plugins/groups/groups_model.rb
596
604
  - plugins/groups/groups_renderer.rb
597
605
  - plugins/groups/schema/system-description-groups.schema-v1.json
606
+ - plugins/groups/schema/system-description-groups.schema-v10.json
598
607
  - plugins/groups/schema/system-description-groups.schema-v2.json
599
608
  - plugins/groups/schema/system-description-groups.schema-v3.json
600
609
  - plugins/groups/schema/system-description-groups.schema-v4.json
@@ -608,6 +617,7 @@ files:
608
617
  - plugins/os/os_model.rb
609
618
  - plugins/os/os_renderer.rb
610
619
  - plugins/os/schema/system-description-os.schema-v1.json
620
+ - plugins/os/schema/system-description-os.schema-v10.json
611
621
  - plugins/os/schema/system-description-os.schema-v2.json
612
622
  - plugins/os/schema/system-description-os.schema-v3.json
613
623
  - plugins/os/schema/system-description-os.schema-v4.json
@@ -621,6 +631,7 @@ files:
621
631
  - plugins/packages/packages_model.rb
622
632
  - plugins/packages/packages_renderer.rb
623
633
  - plugins/packages/schema/system-description-packages.schema-v1.json
634
+ - plugins/packages/schema/system-description-packages.schema-v10.json
624
635
  - plugins/packages/schema/system-description-packages.schema-v2.json
625
636
  - plugins/packages/schema/system-description-packages.schema-v3.json
626
637
  - plugins/packages/schema/system-description-packages.schema-v4.json
@@ -634,6 +645,7 @@ files:
634
645
  - plugins/patterns/patterns_model.rb
635
646
  - plugins/patterns/patterns_renderer.rb
636
647
  - plugins/patterns/schema/system-description-patterns.schema-v1.json
648
+ - plugins/patterns/schema/system-description-patterns.schema-v10.json
637
649
  - plugins/patterns/schema/system-description-patterns.schema-v2.json
638
650
  - plugins/patterns/schema/system-description-patterns.schema-v3.json
639
651
  - plugins/patterns/schema/system-description-patterns.schema-v4.json
@@ -647,6 +659,7 @@ files:
647
659
  - plugins/repositories/repositories_model.rb
648
660
  - plugins/repositories/repositories_renderer.rb
649
661
  - plugins/repositories/schema/system-description-repositories.schema-v1.json
662
+ - plugins/repositories/schema/system-description-repositories.schema-v10.json
650
663
  - plugins/repositories/schema/system-description-repositories.schema-v2.json
651
664
  - plugins/repositories/schema/system-description-repositories.schema-v3.json
652
665
  - plugins/repositories/schema/system-description-repositories.schema-v4.json
@@ -656,6 +669,7 @@ files:
656
669
  - plugins/repositories/schema/system-description-repositories.schema-v8.json
657
670
  - plugins/repositories/schema/system-description-repositories.schema-v9.json
658
671
  - plugins/services/schema/system-description-services.schema-v1.json
672
+ - plugins/services/schema/system-description-services.schema-v10.json
659
673
  - plugins/services/schema/system-description-services.schema-v2.json
660
674
  - plugins/services/schema/system-description-services.schema-v3.json
661
675
  - plugins/services/schema/system-description-services.schema-v4.json
@@ -669,6 +683,7 @@ files:
669
683
  - plugins/services/services_model.rb
670
684
  - plugins/services/services_renderer.rb
671
685
  - plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v1.json
686
+ - plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v10.json
672
687
  - plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v2.json
673
688
  - plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v3.json
674
689
  - plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v4.json
@@ -682,6 +697,7 @@ files:
682
697
  - plugins/unmanaged_files/unmanaged_files_model.rb
683
698
  - plugins/unmanaged_files/unmanaged_files_renderer.rb
684
699
  - plugins/users/schema/system-description-users.schema-v1.json
700
+ - plugins/users/schema/system-description-users.schema-v10.json
685
701
  - plugins/users/schema/system-description-users.schema-v2.json
686
702
  - plugins/users/schema/system-description-users.schema-v3.json
687
703
  - plugins/users/schema/system-description-users.schema-v4.json
@@ -702,7 +718,9 @@ files:
702
718
  - schema/migrations/migrate6to7.rb
703
719
  - schema/migrations/migrate7to8.rb
704
720
  - schema/migrations/migrate8to9.rb
721
+ - schema/migrations/migrate9to10.rb
705
722
  - schema/system-description-global.schema-v1.json
723
+ - schema/system-description-global.schema-v10.json
706
724
  - schema/system-description-global.schema-v2.json
707
725
  - schema/system-description-global.schema-v3.json
708
726
  - schema/system-description-global.schema-v4.json
@@ -749,7 +767,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
749
767
  requirements:
750
768
  - - ">="
751
769
  - !ruby/object:Gem::Version
752
- version: 1.9.2
770
+ version: 2.0.0
753
771
  required_rubygems_version: !ruby/object:Gem::Requirement
754
772
  requirements:
755
773
  - - ">="
@@ -1,62 +0,0 @@
1
- !!!
2
- %html
3
- %head
4
- %title
5
- Machinery System Descriptions
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/jquery.searcher.min.js" }
11
- %script{ :src => "assets/machinery-base.js" }
12
- %script{ :src => "assets/show/machinery.js" }
13
- %script{ :src => "assets/bootstrap-tooltip.js" }
14
- %script{ :src => "assets/bootstrap-popover.js" }
15
-
16
- %body
17
- .container-fluid
18
- #nav-bar
19
- .row
20
- .col-xs-1
21
- .col-xs-10
22
- %h1
23
- System Descriptions
24
- .row
25
- .filter-input.col-md-3.col-md-offset-1
26
- %input.col-md-8#filter{ :placeholder => "Type to Filter" }
27
- %a.btn.btn-default.btn-reset{ :href => "#", :title => "Reset Filter" }
28
- %span Reset
29
-
30
- .col-xs-6.nav-buttons
31
- %small.pull-right
32
- created by
33
- %a{ :href => "http://machinery-project.org", :target => "_blank" }
34
- Machinery
35
- %br
36
- %a{ :href => "/site/docs/", :target => "_blank" }
37
- Machinery documentation
38
-
39
-
40
- #content_container
41
- = render_partial "landing_page/alert"
42
- - if @all_descriptions.empty?
43
- %p.col-md-5.col-md-offset-1
44
- %strong
45
- No system descriptions available on your machine.
46
- - else
47
- %table.table.table-striped.table-condensed.filterable
48
- %thead
49
- %tr
50
- %th Name
51
- %th Last update
52
- %th Scopes
53
- %th Host
54
- %tbody
55
- - @all_descriptions.each do |key, value|
56
- %tr
57
- %td
58
- %a{ :href => "/#{key}" }
59
- #{key}
60
- %td= value["date"]
61
- %td= value["scopes"].join(", ")
62
- %td= value["host"].join(", ")