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.
- checksums.yaml +4 -4
- data/.git_revision +1 -1
- data/NEWS +17 -0
- data/bin/machinery +10 -2
- data/html/comparison.html.haml +1 -1
- data/html/index.html.haml +2 -2
- data/html/partials/{config_files.html.haml → changed_config_files.html.haml} +10 -10
- data/html/partials/compare/changed_config_files.html.haml +48 -0
- data/html/partials/compare/{config_file_list.html.haml → changed_config_files_list.html.haml} +0 -0
- data/html/partials/compare/unmanaged_file_list.html.haml +1 -1
- data/html/partials/compare/unmanaged_files.html.haml +2 -2
- data/html/partials/patterns.html.haml +5 -0
- data/html/upgrade.html.haml +49 -0
- data/lib/{analyze_config_file_diffs_task.rb → analyze_changed_config_files_diffs_task.rb} +8 -8
- data/lib/autoyast.rb +12 -13
- data/lib/build_task.rb +2 -2
- data/lib/cli.rb +39 -32
- data/lib/compare_task.rb +1 -1
- data/lib/config_base.rb +1 -1
- data/lib/deploy_task.rb +4 -4
- data/lib/docker_system.rb +1 -1
- data/lib/element_filter.rb +3 -3
- data/lib/export_task.rb +3 -3
- data/lib/file_validator.rb +8 -5
- data/lib/filter.rb +5 -5
- data/lib/filter_option_parser.rb +3 -3
- data/lib/hint.rb +9 -4
- data/lib/html.rb +3 -3
- data/lib/inspect_task.rb +3 -3
- data/lib/json_schema_monkey_patch.rb +2 -2
- data/lib/json_validation_error_cleaner.rb +1 -1
- data/lib/json_validator.rb +2 -2
- data/lib/kiwi_config.rb +39 -14
- data/lib/list_task.rb +1 -1
- data/lib/local_system.rb +4 -4
- data/lib/machinery.rb +1 -1
- data/lib/machinery_logger.rb +4 -4
- data/lib/manifest.rb +5 -5
- data/lib/migration.rb +4 -4
- data/lib/object.rb +6 -10
- data/lib/remove_task.rb +1 -1
- data/lib/renderer.rb +5 -5
- data/lib/scope_file_access_archive.rb +2 -2
- data/lib/scope_file_access_flat.rb +3 -3
- data/lib/scope_file_store.rb +3 -3
- data/lib/serve_html_task.rb +15 -2
- data/lib/server.rb +32 -12
- data/lib/system.rb +1 -1
- data/lib/system_description.rb +16 -14
- data/lib/system_description_store.rb +5 -6
- data/lib/ui.rb +1 -1
- data/lib/upgrade_format_task.rb +2 -2
- data/lib/version.rb +1 -1
- data/lib/workload_mapper.rb +11 -11
- data/lib/zypper.rb +1 -1
- data/machinery-helper/Rakefile +1 -1
- data/machinery-helper/version.go +1 -1
- data/man/generated/machinery.1.gz +0 -0
- data/manual/docs/machinery-analyze.1.md +3 -3
- data/manual/docs/machinery-compare.1.md +2 -2
- data/manual/docs/machinery-inspect-docker.1.md +1 -1
- data/manual/docs/machinery-inspect.1.md +4 -1
- data/manual/docs/machinery-show.1.md +2 -2
- data/manual/docs/machinery_main_general.1.md +1 -1
- data/manual/docs/machinery_main_scopes.1.md +8 -6
- data/manual/site/machinery-analyze.1/index.html +3 -3
- data/manual/site/machinery-compare.1/index.html +2 -2
- data/manual/site/machinery-inspect-docker.1/index.html +1 -1
- data/manual/site/machinery-inspect.1/index.html +3 -1
- data/manual/site/machinery-show.1/index.html +2 -2
- data/manual/site/machinery_main_general.1/index.html +1 -1
- data/manual/site/machinery_main_scopes.1/index.html +8 -6
- data/manual/site/mkdocs/search_index.json +17 -17
- data/manual/site/sitemap.xml +23 -23
- data/plugins/{config_files/config_files.yml → changed_config_files/changed_config_files.yml} +3 -3
- data/plugins/{config_files/config_files_inspector.rb → changed_config_files/changed_config_files_inspector.rb} +14 -10
- data/plugins/{config_files/config_files_model.rb → changed_config_files/changed_config_files_model.rb} +1 -1
- data/plugins/{config_files/config_files_renderer.rb → changed_config_files/changed_config_files_renderer.rb} +9 -9
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- data/plugins/changed_config_files/schema/system-description-changed-config-files.schema-v8.json +160 -0
- data/plugins/changed_managed_files/changed_managed_files_inspector.rb +6 -2
- data/plugins/changed_managed_files/changed_managed_files_renderer.rb +1 -1
- data/plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v8.json +160 -0
- data/plugins/environment/schema/system-description-environment.schema-v8.json +17 -0
- data/plugins/groups/groups_inspector.rb +1 -1
- data/plugins/groups/groups_renderer.rb +1 -1
- data/plugins/groups/schema/system-description-groups.schema-v8.json +49 -0
- data/plugins/os/os_inspector.rb +6 -6
- data/plugins/os/os_renderer.rb +1 -1
- data/plugins/os/schema/system-description-os.schema-v8.json +21 -0
- data/plugins/packages/packages_inspector.rb +1 -1
- data/plugins/packages/schema/system-description-packages.schema-v8.json +115 -0
- data/plugins/patterns/patterns.yml +5 -3
- data/plugins/patterns/patterns_inspector.rb +4 -3
- data/plugins/patterns/patterns_renderer.rb +5 -1
- data/plugins/patterns/schema/system-description-patterns.schema-v8.json +58 -0
- data/plugins/repositories/repositories_inspector.rb +2 -1
- data/plugins/repositories/schema/system-description-repositories.schema-v8.json +165 -0
- data/plugins/services/schema/system-description-services.schema-v8.json +93 -0
- data/plugins/services/services.yml +1 -1
- data/plugins/services/services_inspector.rb +1 -1
- data/plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v8.json +124 -0
- data/plugins/unmanaged_files/unmanaged_files_inspector.rb +9 -4
- data/plugins/unmanaged_files/unmanaged_files_model.rb +12 -5
- data/plugins/unmanaged_files/unmanaged_files_renderer.rb +1 -1
- data/plugins/users/schema/system-description-users.schema-v8.json +86 -0
- data/plugins/users/users_inspector.rb +7 -7
- data/schema/migrations/migrate1to2.rb +4 -4
- data/schema/migrations/migrate2to3.rb +1 -1
- data/schema/migrations/migrate3to4.rb +9 -9
- data/schema/migrations/migrate7to8.rb +47 -0
- data/schema/system-description-global.schema-v8.json +43 -0
- data/workload_mapper/rails/setup/setup.rb.erb +1 -1
- data/workload_mapper/wordpress/setup/setup.rb.erb +1 -1
- metadata +31 -17
- data/html/partials/compare/config_files.html.haml +0 -48
@@ -0,0 +1,93 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
|
4
|
+
"type": "object",
|
5
|
+
"required": [
|
6
|
+
"_elements"
|
7
|
+
],
|
8
|
+
"oneOf": [
|
9
|
+
{
|
10
|
+
"properties": {
|
11
|
+
"_attributes": {
|
12
|
+
"type": "object",
|
13
|
+
"required": [
|
14
|
+
"init_system"
|
15
|
+
],
|
16
|
+
"properties": {
|
17
|
+
"init_system": {
|
18
|
+
"not": {
|
19
|
+
"enum": [
|
20
|
+
"upstart"
|
21
|
+
]
|
22
|
+
},
|
23
|
+
"type": "string",
|
24
|
+
"minLength": 1
|
25
|
+
}
|
26
|
+
}
|
27
|
+
},
|
28
|
+
"_elements": {
|
29
|
+
"type": "array",
|
30
|
+
"items": {
|
31
|
+
"type": "object",
|
32
|
+
"required": [
|
33
|
+
"name",
|
34
|
+
"state"
|
35
|
+
],
|
36
|
+
"properties": {
|
37
|
+
"name": {
|
38
|
+
"type": "string",
|
39
|
+
"minLength": 1
|
40
|
+
},
|
41
|
+
"state": {
|
42
|
+
"type": "string",
|
43
|
+
"minLength": 1
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"properties": {
|
52
|
+
"_attributes": {
|
53
|
+
"type": "object",
|
54
|
+
"required": [
|
55
|
+
"init_system"
|
56
|
+
],
|
57
|
+
"properties": {
|
58
|
+
"init_system": {
|
59
|
+
"enum": [
|
60
|
+
"upstart"
|
61
|
+
]
|
62
|
+
}
|
63
|
+
}
|
64
|
+
},
|
65
|
+
"_elements": {
|
66
|
+
"type": "array",
|
67
|
+
"items": {
|
68
|
+
"type": "object",
|
69
|
+
"required": [
|
70
|
+
"name",
|
71
|
+
"state",
|
72
|
+
"legacy_sysv"
|
73
|
+
],
|
74
|
+
"properties": {
|
75
|
+
"name": {
|
76
|
+
"type": "string",
|
77
|
+
"minLength": 1
|
78
|
+
},
|
79
|
+
"state": {
|
80
|
+
"type": "string",
|
81
|
+
"minLength": 1
|
82
|
+
},
|
83
|
+
"legacy_sysv": {
|
84
|
+
"type": "boolean"
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
]
|
92
|
+
}
|
93
|
+
|
@@ -7,4 +7,4 @@
|
|
7
7
|
The scope determines which services are configured to be started in which
|
8
8
|
runlevel. It uses the `chkconfig` command to obtain that information.
|
9
9
|
The xinetd services that are also displayed by `chkconfig` are switched
|
10
|
-
on/off by editing
|
10
|
+
on/off by editing configuration files and are ignored in this context.
|
@@ -0,0 +1,124 @@
|
|
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
|
+
"required": [
|
12
|
+
"extracted",
|
13
|
+
"has_metadata"
|
14
|
+
],
|
15
|
+
"properties": {
|
16
|
+
"extracted": {
|
17
|
+
"type": "boolean"
|
18
|
+
},
|
19
|
+
"has_metadata": {
|
20
|
+
"type": "boolean"
|
21
|
+
}
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"_elements": {
|
25
|
+
"type": "array",
|
26
|
+
"items": {
|
27
|
+
"anyOf": [
|
28
|
+
{
|
29
|
+
"$ref": "#/definitions/file"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"$ref": "#/definitions/file_remote_dir"
|
33
|
+
}
|
34
|
+
]
|
35
|
+
}
|
36
|
+
}
|
37
|
+
},
|
38
|
+
"definitions": {
|
39
|
+
"file_common": {
|
40
|
+
"type": "object",
|
41
|
+
"required": ["name", "type"],
|
42
|
+
"properties": {
|
43
|
+
"name": {
|
44
|
+
"type": "string"
|
45
|
+
}
|
46
|
+
}
|
47
|
+
},
|
48
|
+
"file": {
|
49
|
+
"allOf": [
|
50
|
+
{ "$ref": "#/definitions/file_common" },
|
51
|
+
{
|
52
|
+
"properties": {
|
53
|
+
"user": {
|
54
|
+
"type": "string",
|
55
|
+
"minLength": 1
|
56
|
+
},
|
57
|
+
"group": {
|
58
|
+
"type": "string",
|
59
|
+
"minLength": 1
|
60
|
+
}
|
61
|
+
},
|
62
|
+
"oneOf": [
|
63
|
+
{ "$ref": "#/definitions/file_file" },
|
64
|
+
{ "$ref": "#/definitions/file_dir" },
|
65
|
+
{ "$ref": "#/definitions/file_link" }
|
66
|
+
]
|
67
|
+
}
|
68
|
+
]
|
69
|
+
},
|
70
|
+
"file_file": {
|
71
|
+
"properties": {
|
72
|
+
"type": {
|
73
|
+
"enum": ["file"]
|
74
|
+
},
|
75
|
+
"size": {
|
76
|
+
"type": "integer",
|
77
|
+
"minimum": 0
|
78
|
+
},
|
79
|
+
"mode": {
|
80
|
+
"type": "string",
|
81
|
+
"pattern": "^[0-7]{3,4}$"
|
82
|
+
}
|
83
|
+
}
|
84
|
+
},
|
85
|
+
"file_dir": {
|
86
|
+
"properties": {
|
87
|
+
"type": {
|
88
|
+
"enum": ["dir"]
|
89
|
+
},
|
90
|
+
"size": {
|
91
|
+
"type": "integer",
|
92
|
+
"minimum": 0
|
93
|
+
},
|
94
|
+
"mode": {
|
95
|
+
"type": "string",
|
96
|
+
"pattern": "^[0-4]?[0-7]{3}$"
|
97
|
+
},
|
98
|
+
"files": {
|
99
|
+
"type": "integer",
|
100
|
+
"minimum": 0
|
101
|
+
}
|
102
|
+
}
|
103
|
+
},
|
104
|
+
"file_link": {
|
105
|
+
"properties": {
|
106
|
+
"type": {
|
107
|
+
"enum": ["link"]
|
108
|
+
}
|
109
|
+
}
|
110
|
+
},
|
111
|
+
"file_remote_dir": {
|
112
|
+
"allOf": [
|
113
|
+
{ "$ref": "#/definitions/file_common" },
|
114
|
+
{
|
115
|
+
"properties": {
|
116
|
+
"type": {
|
117
|
+
"enum": ["remote_dir"]
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}
|
121
|
+
]
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
@@ -72,7 +72,7 @@ class UnmanagedFilesInspector < Inspector
|
|
72
72
|
def run_helper_inspection(helper, filter, file_store_tmp, file_store_final, scope, options)
|
73
73
|
begin
|
74
74
|
helper.inject_helper
|
75
|
-
|
75
|
+
unless helper.has_compatible_version?
|
76
76
|
raise Machinery::Errors::UnsupportedHelperVersion.new(
|
77
77
|
"Error: machinery-helper is not compatible with this Machinery version." \
|
78
78
|
"\nTry to reinstall the package or gem to fix the issue."
|
@@ -120,14 +120,19 @@ class UnmanagedFilesInspector < Inspector
|
|
120
120
|
|
121
121
|
def summary
|
122
122
|
"#{@description.unmanaged_files.extracted ? "Extracted" : "Found"} " +
|
123
|
-
|
123
|
+
Machinery.pluralize(
|
124
|
+
@description.unmanaged_files.count,
|
125
|
+
"%d unmanaged file or tree.",
|
126
|
+
"%d unmanaged files and/or trees."
|
127
|
+
)
|
124
128
|
end
|
125
129
|
|
126
130
|
private
|
127
131
|
|
128
132
|
def show_extraction_progress(count)
|
129
|
-
progress = Machinery
|
130
|
-
count, " -> Extracted %d file or tree",
|
133
|
+
progress = Machinery.pluralize(
|
134
|
+
count, " -> Extracted %d unmanaged file or tree...",
|
135
|
+
" -> Extracted %d unmanaged files and/or trees..."
|
131
136
|
)
|
132
137
|
Machinery::Ui.progress(progress)
|
133
138
|
end
|
@@ -40,14 +40,14 @@ class UnmanagedFilesScope < FileScope
|
|
40
40
|
both = []
|
41
41
|
only_self = []
|
42
42
|
elements.each do |element|
|
43
|
-
if other_hash.
|
43
|
+
if other_hash.key?(element.name) && files_match(element, other_hash[element.name])
|
44
44
|
both << element
|
45
45
|
else
|
46
46
|
only_self << element
|
47
47
|
end
|
48
48
|
end
|
49
49
|
only_other = other.elements.reject do |element|
|
50
|
-
self_hash.
|
50
|
+
self_hash.key?(element.name) && files_match(element, self_hash[element.name])
|
51
51
|
end
|
52
52
|
changed = Machinery::Scope.extract_changed_elements(only_self, only_other, :name)
|
53
53
|
|
@@ -58,12 +58,19 @@ class UnmanagedFilesScope < FileScope
|
|
58
58
|
only_other_attributes = other.attributes
|
59
59
|
end
|
60
60
|
|
61
|
-
[
|
61
|
+
comparison = [
|
62
62
|
self.class.new(only_self, only_self_attributes || {}),
|
63
63
|
self.class.new(only_other, only_other_attributes || {}),
|
64
|
-
changed
|
65
|
-
self.class.new(both, common_attributes || {})
|
64
|
+
changed
|
66
65
|
].map { |e| e.empty? ? nil : e }
|
66
|
+
|
67
|
+
common = if both.empty? && common_attributes && common_attributes.empty?
|
68
|
+
nil
|
69
|
+
else
|
70
|
+
self.class.new(both, common_attributes || {})
|
71
|
+
end
|
72
|
+
|
73
|
+
comparison.push(common)
|
67
74
|
end
|
68
75
|
|
69
76
|
private
|
@@ -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
|
+
|
@@ -33,7 +33,7 @@ class UsersInspector < Inspector
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def summary
|
36
|
-
"Found #{@description.users.size}
|
36
|
+
"Found #{Machinery.pluralize(@description.users.size, "%d user")}."
|
37
37
|
end
|
38
38
|
|
39
39
|
private
|
@@ -83,12 +83,12 @@ class UsersInspector < Inspector
|
|
83
83
|
result = {
|
84
84
|
encrypted_password: passwd
|
85
85
|
}
|
86
|
-
result[:last_changed_date] = changed.to_i
|
87
|
-
result[:min_days] = min.to_i
|
88
|
-
result[:max_days] = max.to_i
|
89
|
-
result[:warn_days] = warn.to_i
|
90
|
-
result[:disable_days] = inactive.to_i
|
91
|
-
result[:disabled_date] = expire.to_i
|
86
|
+
result[:last_changed_date] = changed.to_i unless changed.empty?
|
87
|
+
result[:min_days] = min.to_i unless min.empty?
|
88
|
+
result[:max_days] = max.to_i unless max.empty?
|
89
|
+
result[:warn_days] = warn.to_i unless warn.empty?
|
90
|
+
result[:disable_days] = inactive.to_i unless inactive.empty?
|
91
|
+
result[:disabled_date] = expire.to_i unless expire.empty?
|
92
92
|
|
93
93
|
result
|
94
94
|
else
|
@@ -34,10 +34,10 @@ class Migrate1To2 < Migration
|
|
34
34
|
"changed_managed_files",
|
35
35
|
"unmanaged_files"
|
36
36
|
].each do |scope|
|
37
|
-
next
|
37
|
+
next unless @hash.key?(scope)
|
38
38
|
|
39
39
|
files = @hash[scope]
|
40
|
-
is_extracted = Dir.
|
40
|
+
is_extracted = Dir.exist?(File.join(@path, scope))
|
41
41
|
|
42
42
|
@hash[scope] = {
|
43
43
|
"extracted" => is_extracted,
|
@@ -45,9 +45,9 @@ class Migrate1To2 < Migration
|
|
45
45
|
}
|
46
46
|
end
|
47
47
|
|
48
|
-
if @hash.
|
48
|
+
if @hash.key?("groups")
|
49
49
|
@hash["groups"].each do |element|
|
50
|
-
|
50
|
+
unless element["gid"]
|
51
51
|
element["gid"] = nil
|
52
52
|
end
|
53
53
|
end
|