machinery-tool 1.17.0 → 1.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (310) hide show
  1. checksums.yaml +4 -4
  2. data/.git_revision +1 -1
  3. data/NEWS +17 -1
  4. data/bin/machinery +1 -1
  5. data/export_helpers/merge_users_and_groups.pl.erb +1 -1
  6. data/html/comparison.html.haml +14 -9
  7. data/html/index.html.haml +5 -2
  8. data/html/landing_page.html.haml +4 -1
  9. data/html/partials/changed_managed_files.html.haml +2 -0
  10. data/html/partials/compare/alert.html.haml +1 -1
  11. data/html/partials/compare/unmanaged_file_list.html.haml +12 -0
  12. data/html/partials/config_files.html.haml +2 -0
  13. data/html/partials/landing_page/alert.html.haml +1 -1
  14. data/html/partials/unmanaged_files.html.haml +14 -0
  15. data/inspect_helpers/changed_files.sh +1 -1
  16. data/inspect_helpers/dpkg_unmanaged_files.sh +1 -1
  17. data/inspect_helpers/yum_repositories.py +1 -1
  18. data/lib/analyze_config_file_diffs_task.rb +1 -1
  19. data/lib/array.rb +1 -1
  20. data/lib/autoyast.rb +34 -34
  21. data/lib/build_task.rb +1 -1
  22. data/lib/cli.rb +21 -6
  23. data/lib/compare_task.rb +1 -1
  24. data/lib/comparison.rb +1 -1
  25. data/lib/config.rb +1 -1
  26. data/lib/config_base.rb +1 -1
  27. data/lib/config_task.rb +1 -1
  28. data/lib/constants.rb +2 -2
  29. data/lib/containerize_task.rb +1 -1
  30. data/lib/containerized_app.rb +1 -1
  31. data/lib/copy_task.rb +1 -1
  32. data/lib/current_user.rb +1 -1
  33. data/lib/deploy_task.rb +1 -1
  34. data/lib/docker_system.rb +4 -5
  35. data/lib/dpkg_database.rb +2 -2
  36. data/lib/element_filter.rb +1 -1
  37. data/lib/exceptions.rb +2 -2
  38. data/lib/export_task.rb +1 -1
  39. data/lib/exporter.rb +1 -1
  40. data/lib/file_diff.rb +1 -1
  41. data/lib/file_scope.rb +1 -1
  42. data/lib/file_validator.rb +1 -1
  43. data/lib/filter.rb +1 -1
  44. data/lib/filter_option_parser.rb +1 -1
  45. data/lib/helper.rb +1 -1
  46. data/lib/hint.rb +1 -1
  47. data/lib/html.rb +1 -1
  48. data/lib/inspect_task.rb +1 -1
  49. data/lib/inspector.rb +1 -1
  50. data/lib/json_schema_monkey_patch.rb +35 -0
  51. data/lib/json_validation_error_cleaner.rb +1 -1
  52. data/lib/json_validator.rb +1 -1
  53. data/lib/kiwi_config.rb +69 -67
  54. data/lib/list_task.rb +1 -1
  55. data/lib/local_system.rb +1 -1
  56. data/lib/logged_cheetah.rb +1 -1
  57. data/lib/machinery.rb +6 -2
  58. data/lib/machinery_helper.rb +28 -8
  59. data/lib/machinery_logger.rb +1 -1
  60. data/lib/man_task.rb +50 -5
  61. data/lib/managed_files_database.rb +24 -17
  62. data/lib/manifest.rb +3 -2
  63. data/lib/migration.rb +1 -1
  64. data/lib/mountpoints.rb +1 -1
  65. data/lib/move_task.rb +1 -1
  66. data/lib/object.rb +1 -1
  67. data/lib/remote_system.rb +2 -2
  68. data/lib/remove_task.rb +1 -1
  69. data/lib/renderer.rb +1 -1
  70. data/lib/renderer_helper.rb +1 -1
  71. data/lib/rpm.rb +1 -1
  72. data/lib/rpm_database.rb +1 -1
  73. data/lib/scope.rb +1 -1
  74. data/lib/scope_file_store.rb +1 -1
  75. data/lib/serve_html_task.rb +1 -1
  76. data/lib/server.rb +32 -2
  77. data/lib/show_task.rb +1 -1
  78. data/lib/system.rb +1 -1
  79. data/lib/system_description.rb +2 -2
  80. data/lib/system_description_memory_store.rb +1 -1
  81. data/lib/system_description_store.rb +1 -1
  82. data/lib/system_file.rb +1 -1
  83. data/lib/tarball.rb +1 -1
  84. data/lib/tee_io.rb +39 -0
  85. data/lib/try.rb +1 -1
  86. data/lib/ui.rb +1 -1
  87. data/lib/upgrade_format_task.rb +1 -1
  88. data/lib/validate_task.rb +1 -1
  89. data/lib/version.rb +2 -2
  90. data/lib/workload_mapper.rb +1 -1
  91. data/lib/workload_mapper_dsl.rb +1 -1
  92. data/lib/zypper.rb +3 -3
  93. data/machinery-helper/Rakefile +2 -8
  94. data/machinery-helper/file_utils.go +28 -0
  95. data/machinery-helper/file_utils_test.go +21 -0
  96. data/machinery-helper/machinery_helper.go +121 -8
  97. data/machinery-helper/machinery_helper_test.go +102 -0
  98. data/machinery-helper/mountpoints_test.go +33 -33
  99. data/machinery-helper/version.go +1 -1
  100. data/man/generated/machinery.1.gz +0 -0
  101. data/manual/custom_theme/base.html +42 -0
  102. data/manual/docs/CNAME +1 -0
  103. data/manual/docs/README.md +128 -0
  104. data/manual/docs/css/bootstrap.min.css +7 -0
  105. data/manual/docs/css/custom.css +788 -0
  106. data/manual/docs/css/fixed-positioning.css +45 -0
  107. data/manual/docs/custom.css +804 -0
  108. data/manual/docs/docs.md +7 -0
  109. data/manual/docs/favicon.png +0 -0
  110. data/manual/docs/hand3.png +0 -0
  111. data/manual/docs/img/arrow.png +0 -0
  112. data/manual/docs/img/background/1.png +0 -0
  113. data/manual/docs/img/background/2.png +0 -0
  114. data/manual/docs/img/background/3.png +0 -0
  115. data/manual/docs/img/background/4.png +0 -0
  116. data/manual/docs/img/background/5.png +0 -0
  117. data/manual/docs/img/background/6.png +0 -0
  118. data/manual/docs/img/background/7.png +0 -0
  119. data/manual/docs/img/bk-cloud.png +0 -0
  120. data/manual/docs/img/bk-sec-15.png +0 -0
  121. data/manual/docs/img/book.png +0 -0
  122. data/manual/docs/img/configuration-discovery.png +0 -0
  123. data/manual/docs/img/dot-line-left.png +0 -0
  124. data/manual/docs/img/dot-line-right.png +0 -0
  125. data/manual/docs/img/gear.png +0 -0
  126. data/manual/docs/img/gear2.png +0 -0
  127. data/manual/docs/img/gear3.png +0 -0
  128. data/manual/docs/img/hand.png +0 -0
  129. data/manual/docs/img/hand2.png +0 -0
  130. data/manual/docs/img/hand3.png +0 -0
  131. data/manual/docs/img/home2.png +0 -0
  132. data/manual/docs/img/moustache.png +0 -0
  133. data/manual/docs/img/navig.png +0 -0
  134. data/manual/docs/img/philo.png +0 -0
  135. data/manual/docs/img/service-migration.png +0 -0
  136. data/manual/docs/img/system-validation.png +0 -0
  137. data/manual/docs/img/ticket2.png +0 -0
  138. data/manual/docs/img/usecase-default.png +0 -0
  139. data/manual/docs/img/usecase1.png +0 -0
  140. data/manual/docs/img/usecase2.png +0 -0
  141. data/manual/docs/img/usecase3.png +0 -0
  142. data/manual/docs/img/usecase4.png +0 -0
  143. data/manual/docs/img/wheels.png +0 -0
  144. data/manual/docs/index.html +402 -0
  145. data/manual/docs/js/bootstrap.min.js +6 -0
  146. data/manual/docs/js/custom.js +148 -0
  147. data/manual/docs/js/jquery.js +4 -0
  148. data/manual/docs/js/jquery.nicescroll.min.js +116 -0
  149. data/manual/docs/js/jquery.pageslide.min.js +11 -0
  150. data/manual/docs/js/parallaxImg.js +146 -0
  151. data/manual/docs/js/skrollr.min.js +2 -0
  152. data/manual/docs/machinery-analyze.1.md +37 -0
  153. data/manual/docs/machinery-build.1.md +62 -0
  154. data/manual/docs/machinery-compare.1.md +63 -0
  155. data/manual/docs/machinery-config.1.md +45 -0
  156. data/manual/docs/machinery-copy.1.md +31 -0
  157. data/manual/docs/machinery-deploy.1.md +71 -0
  158. data/manual/docs/machinery-export-autoyast.1.md +58 -0
  159. data/manual/docs/machinery-export-kiwi.1.md +38 -0
  160. data/manual/docs/machinery-inspect-docker.1.md +108 -0
  161. data/manual/docs/machinery-inspect.1.md +145 -0
  162. data/manual/docs/machinery-list.1.md +51 -0
  163. data/manual/docs/machinery-man.1.md +16 -0
  164. data/manual/docs/machinery-move.1.md +29 -0
  165. data/manual/docs/machinery-remove.1.md +44 -0
  166. data/manual/docs/machinery-serve.1.md +45 -0
  167. data/manual/docs/machinery-show.1.md +63 -0
  168. data/manual/docs/machinery-upgrade-format.1.md +47 -0
  169. data/manual/docs/machinery-validate.1.md +34 -0
  170. data/manual/docs/machinery.ymp +114 -0
  171. data/manual/docs/machinery_main_general.1.md +139 -0
  172. data/manual/docs/machinery_main_scopes.1.md +98 -0
  173. data/manual/docs/machinery_main_usecases.1.md +49 -0
  174. data/manual/docs/machinery_security_implications.1.md +89 -0
  175. data/manual/docs/subcommand-template.1.md +46 -0
  176. data/manual/docs/wheels.png +0 -0
  177. data/manual/mkdocs.yml +30 -0
  178. data/manual/site/CNAME +1 -0
  179. data/manual/site/base.html +42 -0
  180. data/manual/site/css/bootstrap.min.css +7 -0
  181. data/manual/site/css/custom.css +788 -0
  182. data/manual/site/css/fixed-positioning.css +45 -0
  183. data/manual/site/custom.css +804 -0
  184. data/manual/site/docs/index.html +144 -0
  185. data/manual/site/favicon.png +0 -0
  186. data/manual/site/hand3.png +0 -0
  187. data/manual/site/img/arrow.png +0 -0
  188. data/manual/site/img/background/1.png +0 -0
  189. data/manual/site/img/background/2.png +0 -0
  190. data/manual/site/img/background/3.png +0 -0
  191. data/manual/site/img/background/4.png +0 -0
  192. data/manual/site/img/background/5.png +0 -0
  193. data/manual/site/img/background/6.png +0 -0
  194. data/manual/site/img/background/7.png +0 -0
  195. data/manual/site/img/bk-cloud.png +0 -0
  196. data/manual/site/img/bk-sec-15.png +0 -0
  197. data/manual/site/img/book.png +0 -0
  198. data/manual/site/img/configuration-discovery.png +0 -0
  199. data/manual/site/img/dot-line-left.png +0 -0
  200. data/manual/site/img/dot-line-right.png +0 -0
  201. data/manual/site/img/gear.png +0 -0
  202. data/manual/site/img/gear2.png +0 -0
  203. data/manual/site/img/gear3.png +0 -0
  204. data/manual/site/img/hand.png +0 -0
  205. data/manual/site/img/hand2.png +0 -0
  206. data/manual/site/img/hand3.png +0 -0
  207. data/manual/site/img/home2.png +0 -0
  208. data/manual/site/img/moustache.png +0 -0
  209. data/manual/site/img/navig.png +0 -0
  210. data/manual/site/img/philo.png +0 -0
  211. data/manual/site/img/service-migration.png +0 -0
  212. data/manual/site/img/system-validation.png +0 -0
  213. data/manual/site/img/ticket2.png +0 -0
  214. data/manual/site/img/usecase-default.png +0 -0
  215. data/manual/site/img/usecase1.png +0 -0
  216. data/manual/site/img/usecase2.png +0 -0
  217. data/manual/site/img/usecase3.png +0 -0
  218. data/manual/site/img/usecase4.png +0 -0
  219. data/manual/site/img/wheels.png +0 -0
  220. data/manual/site/index.html +402 -0
  221. data/manual/site/js/bootstrap.min.js +6 -0
  222. data/manual/site/js/custom.js +148 -0
  223. data/manual/site/js/jquery.js +4 -0
  224. data/manual/site/js/jquery.nicescroll.min.js +116 -0
  225. data/manual/site/js/jquery.pageslide.min.js +11 -0
  226. data/manual/site/js/parallaxImg.js +146 -0
  227. data/manual/site/js/skrollr.min.js +2 -0
  228. data/manual/site/machinery-analyze.1/index.html +167 -0
  229. data/manual/site/machinery-build.1/index.html +198 -0
  230. data/manual/site/machinery-compare.1/index.html +200 -0
  231. data/manual/site/machinery-config.1/index.html +175 -0
  232. data/manual/site/machinery-copy.1/index.html +164 -0
  233. data/manual/site/machinery-deploy.1/index.html +200 -0
  234. data/manual/site/machinery-export-autoyast.1/index.html +188 -0
  235. data/manual/site/machinery-export-kiwi.1/index.html +169 -0
  236. data/manual/site/machinery-inspect-docker.1/index.html +242 -0
  237. data/manual/site/machinery-inspect.1/index.html +283 -0
  238. data/manual/site/machinery-list.1/index.html +180 -0
  239. data/manual/site/machinery-man.1/index.html +148 -0
  240. data/manual/site/machinery-move.1/index.html +162 -0
  241. data/manual/site/machinery-remove.1/index.html +175 -0
  242. data/manual/site/machinery-serve.1/index.html +174 -0
  243. data/manual/site/machinery-show.1/index.html +199 -0
  244. data/manual/site/machinery-upgrade-format.1/index.html +173 -0
  245. data/manual/site/machinery-validate.1/index.html +161 -0
  246. data/manual/site/machinery.ymp +114 -0
  247. data/manual/site/machinery_main_general.1/index.html +260 -0
  248. data/manual/site/machinery_main_scopes.1/index.html +242 -0
  249. data/manual/site/machinery_main_usecases.1/index.html +182 -0
  250. data/manual/site/machinery_security_implications.1/index.html +223 -0
  251. data/manual/site/mkdocs/js/lunr-0.5.7.min.js +7 -0
  252. data/manual/site/mkdocs/js/mustache.min.js +1 -0
  253. data/manual/site/mkdocs/js/require.js +36 -0
  254. data/manual/site/mkdocs/js/search-results-template.mustache +4 -0
  255. data/manual/site/mkdocs/js/search.js +88 -0
  256. data/manual/site/mkdocs/js/text.js +390 -0
  257. data/manual/site/mkdocs/search_index.json +824 -0
  258. data/manual/site/sitemap.xml +152 -0
  259. data/manual/site/wheels.png +0 -0
  260. data/plugins/changed_managed_files/changed_managed_files_inspector.rb +1 -1
  261. data/plugins/changed_managed_files/changed_managed_files_model.rb +1 -1
  262. data/plugins/changed_managed_files/changed_managed_files_renderer.rb +1 -1
  263. data/plugins/changed_managed_files/schema/system-description-changed-managed-files.schema-v7.json +160 -0
  264. data/plugins/config_files/config_files_inspector.rb +1 -1
  265. data/plugins/config_files/config_files_model.rb +1 -1
  266. data/plugins/config_files/config_files_renderer.rb +1 -1
  267. data/plugins/config_files/schema/system-description-config-files.schema-v7.json +160 -0
  268. data/plugins/environment/environment_inspector.rb +1 -1
  269. data/plugins/environment/environment_model.rb +1 -1
  270. data/plugins/environment/schema/system-description-environment.schema-v7.json +17 -0
  271. data/plugins/groups/groups_inspector.rb +1 -1
  272. data/plugins/groups/groups_model.rb +1 -1
  273. data/plugins/groups/groups_renderer.rb +1 -1
  274. data/plugins/groups/schema/system-description-groups.schema-v7.json +49 -0
  275. data/plugins/os/os_inspector.rb +1 -1
  276. data/plugins/os/os_model.rb +1 -1
  277. data/plugins/os/os_renderer.rb +1 -1
  278. data/plugins/os/schema/system-description-os.schema-v7.json +21 -0
  279. data/plugins/packages/packages_inspector.rb +1 -1
  280. data/plugins/packages/packages_model.rb +1 -1
  281. data/plugins/packages/packages_renderer.rb +1 -1
  282. data/plugins/packages/schema/system-description-packages.schema-v7.json +115 -0
  283. data/plugins/patterns/patterns_inspector.rb +6 -6
  284. data/plugins/patterns/patterns_model.rb +1 -1
  285. data/plugins/patterns/patterns_renderer.rb +1 -1
  286. data/plugins/patterns/schema/system-description-patterns.schema-v7.json +58 -0
  287. data/plugins/repositories/repositories_inspector.rb +16 -16
  288. data/plugins/repositories/repositories_model.rb +1 -1
  289. data/plugins/repositories/repositories_renderer.rb +1 -1
  290. data/plugins/repositories/schema/system-description-repositories.schema-v7.json +165 -0
  291. data/plugins/services/schema/system-description-services.schema-v7.json +93 -0
  292. data/plugins/services/services_inspector.rb +1 -1
  293. data/plugins/services/services_model.rb +1 -1
  294. data/plugins/services/services_renderer.rb +1 -1
  295. data/plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v6.json +19 -61
  296. data/plugins/unmanaged_files/schema/system-description-unmanaged-files.schema-v7.json +124 -0
  297. data/plugins/unmanaged_files/unmanaged_files_inspector.rb +21 -436
  298. data/plugins/unmanaged_files/unmanaged_files_model.rb +2 -2
  299. data/plugins/unmanaged_files/unmanaged_files_renderer.rb +2 -2
  300. data/plugins/users/schema/system-description-users.schema-v7.json +86 -0
  301. data/plugins/users/users_inspector.rb +1 -1
  302. data/plugins/users/users_model.rb +1 -1
  303. data/plugins/users/users_renderer.rb +1 -1
  304. data/schema/migrations/migrate1to2.rb +1 -1
  305. data/schema/migrations/migrate6to7.rb +38 -0
  306. data/schema/system-description-global.schema-v7.json +43 -0
  307. data/tools/go.rb +92 -0
  308. data/tools/helper_builder.rb +16 -49
  309. metadata +182 -6
  310. data/man/generated/machinery.1.html +0 -1399
data/lib/compare_task.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/comparison.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/config.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/config_base.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/config_task.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/constants.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
@@ -21,5 +21,5 @@ module Machinery
21
21
  DEFAULT_LOG_FILE = File.join(DEFAULT_CONFIG_DIR, "machinery.log")
22
22
  DEFAULT_CONFIG_FILE = File.join(DEFAULT_CONFIG_DIR, "machinery.config")
23
23
  IMAGE_META_DATA_FILE = "machinery.meta"
24
- HELPER_REMOTE_PATH = "/root"
24
+ HELPER_REMOTE_PATH = "~".freeze
25
25
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/copy_task.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/current_user.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/deploy_task.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/docker_system.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
@@ -95,10 +95,9 @@ class DockerSystem < System
95
95
  created = !File.exists?(archive)
96
96
  out = File.open(archive, "w")
97
97
  begin
98
- run_command(
99
- File.join(
100
- Machinery::HELPER_REMOTE_PATH, "machinery-helper"
101
- ), "tar", "--create", "--gzip", "--null", "--files-from=-",
98
+ helper = MachineryHelper.new(self)
99
+ helper.run_helper_subcommand(
100
+ "tar", "--create", "--gzip", "--null", "--files-from=-",
102
101
  *exclude.flat_map { |f| ["--exclude", f] },
103
102
  stdout: out,
104
103
  stdin: Array(file_list).join("\0"),
data/lib/dpkg_database.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
@@ -18,7 +18,7 @@
18
18
  class DpkgDatabase < 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
- " The reason for this is missing verifcation data:" \
21
+ " The reason for this is missing verification data:" \
22
22
  " https://github.com/SUSE/machinery/wiki/Ubuntu-Inspection"
23
23
 
24
24
  Machinery.logger.warn(message)
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/exceptions.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
@@ -121,7 +121,7 @@ module Machinery
121
121
  def to_s
122
122
  "sudo isn't configured on the inspected host '#{@host}' for user '#{@remote_user}' to " \
123
123
  "give all required commands enough privileges. See 'PREREQUISITES' section in the " \
124
- "machinery man page for a description on how to configure sudo on the inspected host."
124
+ "machinery documentation for a description on how to configure sudo on the inspected host."
125
125
  end
126
126
  end
127
127
 
data/lib/export_task.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/exporter.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/file_diff.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/file_scope.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/filter.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/hint.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/html.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/inspect_task.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/inspector.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
@@ -0,0 +1,35 @@
1
+ # Quick and dirty monkey patch for a performance bug we saw with certain
2
+ # schema constellations
3
+ #
4
+ # The performance issues are that
5
+ # * `build_fragment` joins the elements in `fragments` even though the
6
+ # error message it is used in is never used
7
+ # * the `fragment` array constantly grows
8
+ module JSON
9
+ class Schema
10
+ class EnumAttribute < Attribute
11
+ def self.validate(current_schema, data, fragments, processor, validator, options = {})
12
+ if !current_schema.schema['enum'].include?(data)
13
+ if options[:record_errors]
14
+ message = "The property '#{build_fragment(fragments)}' value #{data.inspect} did not match one of the following values:"
15
+ current_schema.schema['enum'].each {|val|
16
+ if val.is_a?(NilClass)
17
+ message += " null,"
18
+ elsif val.is_a?(Array)
19
+ message += " (array),"
20
+ elsif val.is_a?(Hash)
21
+ message += " (object),"
22
+ else
23
+ message += " #{val.to_s},"
24
+ end
25
+ }
26
+ message.chop!
27
+ validation_error(processor, message, fragments, current_schema, self, options[:record_errors])
28
+ else
29
+ raise ValidationError.new("", [], nil, current_schema)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
data/lib/kiwi_config.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2013-2015 SUSE LLC
1
+ # Copyright (c) 2013-2016 SUSE LLC
2
2
  #
3
3
  # This program is free software; you can redistribute it and/or
4
4
  # modify it under the terms of version 3 of the GNU General Public License as
@@ -16,7 +16,7 @@
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
18
  class KiwiConfig < Exporter
19
- attr_accessor :xml, :sh
19
+ attr_accessor :xml_text, :sh
20
20
  attr_accessor :name
21
21
 
22
22
  def initialize(system_description, options = {})
@@ -41,8 +41,8 @@ class KiwiConfig < Exporter
41
41
 
42
42
  @sh << "baseCleanMount\n"
43
43
  @sh << "exit 0\n"
44
- File.write(File.join(output_location, "config.xml") , @xml.to_xml)
45
- File.write(File.join(output_location, "config.sh") , @sh)
44
+ File.write(File.join(output_location, "config.xml"), xml_text)
45
+ File.write(File.join(output_location, "config.sh"), @sh)
46
46
  FileUtils.cp(
47
47
  File.join(Machinery::ROOT, "export_helpers/kiwi_export_readme.md"),
48
48
  File.join(output_location, "README.md")
@@ -192,41 +192,41 @@ suseImportBuildKey
192
192
  suseConfig
193
193
  EOF
194
194
 
195
- builder = Nokogiri::XML::Builder.new do |xml|
196
- xml.image(schemaversion: "5.8", name: @system_description.name) do
197
- xml.description(type: "system") do
198
- xml.author "Machinery"
199
- xml.contact ""
200
- xml.specification "Description of system '#{@system_description.name}' exported by Machinery"
201
- end
195
+ xml = Builder::XmlMarkup.new(indent: 2)
196
+ xml.instruct! :xml
197
+ xml.image(schemaversion: "5.8", name: @system_description.name) do
198
+ xml.description(type: "system") do
199
+ xml.author "Machinery"
200
+ xml.contact ""
201
+ xml.specification "Description of system '#{@system_description.name}' exported by Machinery"
202
+ end
202
203
 
203
- xml.preferences do
204
- xml.packagemanager "zypper"
205
- xml.version "0.0.1"
206
- xml.type_(
207
- image: "vmx",
208
- filesystem: "ext3",
209
- installiso: "true",
210
- boot: @system_description.os.kiwi_boot,
211
- format: "qcow2", bootloader: @system_description.os.kiwi_bootloader
212
- )
213
- end
204
+ xml.preferences do
205
+ xml.packagemanager "zypper"
206
+ xml.version "0.0.1"
207
+ xml.type(
208
+ image: "vmx",
209
+ filesystem: "ext3",
210
+ installiso: "true",
211
+ boot: @system_description.os.kiwi_boot,
212
+ format: "qcow2", bootloader: @system_description.os.kiwi_bootloader
213
+ )
214
+ end
214
215
 
215
- xml.users(group: "root") do
216
- xml.user(password: "$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0",
217
- home: "/root", name: "root")
218
- end
216
+ xml.users(group: "root") do
217
+ xml.user(password: "$1$wYJUgpM5$RXMMeASDc035eX.NbYWFl0",
218
+ home: "/root", name: "root")
219
+ end
219
220
 
220
221
 
221
- apply_repositories(xml)
222
- apply_packages(xml)
223
- apply_services
224
- end
222
+ apply_repositories(xml)
223
+ apply_packages(xml)
224
+ apply_services
225
225
  end
226
226
 
227
227
  pre_process_config
228
228
 
229
- @xml = builder.doc
229
+ @xml_text = xml.target!
230
230
  end
231
231
 
232
232
  def apply_packages(xml)
@@ -294,46 +294,48 @@ EOF
294
294
  init_system = @system_description["services"].init_system
295
295
 
296
296
  case init_system
297
- when "sysvinit"
298
- @system_description["services"].each do |service|
297
+ when "sysvinit"
298
+ @system_description["services"].each do |service|
299
+ @sh <<
299
300
  if service.state == "on"
300
- @sh << "chkconfig #{service.name} on\n"
301
+ "chkconfig #{service.name} on\n"
301
302
  else
302
- @sh << "chkconfig #{service.name} off\n"
303
- end
304
- end
305
-
306
- when "systemd"
307
- # possible systemd service states:
308
- # http://www.freedesktop.org/software/systemd/man/systemctl.html#Unit%20File%20Commands
309
- @system_description["services"].each do |service|
310
- case service.state
311
- when "enabled"
312
- @sh << "systemctl enable #{service.name}\n"
313
- when "disabled"
314
- @sh << "systemctl disable #{service.name}\n"
315
- when "masked"
316
- @sh << "systemctl mask #{service.name}\n"
317
- when "static"
318
- # Don't do anything because the unit is not meant to be
319
- # enabled/disabled manually.
320
- when "linked"
321
- # Don't do anything because linking doesn't mean enabling
322
- # nor disabling.
323
- when "enabled-runtime"
324
- when "linked-runtime"
325
- when "masked-runtime"
326
- # Don't do anything because these states are not supposed
327
- # to be permanent.
328
- else
329
- raise Machinery::Errors::ExportFailed.new(
330
- "The systemd unit state #{service.state} is unknown."
331
- )
303
+ "chkconfig #{service.name} off\n"
332
304
  end
305
+ end
306
+ when "systemd"
307
+ # possible systemd service states:
308
+ # http://www.freedesktop.org/software/systemd/man/systemctl.html#Unit%20File%20Commands
309
+ @system_description["services"].each do |service|
310
+ case service.state
311
+ when "enabled"
312
+ @sh << "systemctl enable #{service.name}\n"
313
+ when "disabled"
314
+ @sh << "systemctl disable #{service.name}\n"
315
+ when "masked"
316
+ @sh << "systemctl mask #{service.name}\n"
317
+ when "static"
318
+ # Don't do anything because the unit is not meant to be
319
+ # enabled/disabled manually.
320
+ when "linked"
321
+ # Don't do anything because linking doesn't mean enabling
322
+ # nor disabling.
323
+ when "enabled-runtime"
324
+ when "linked-runtime"
325
+ when "masked-runtime"
326
+ # Don't do anything because these states are not supposed
327
+ # to be permanent.
328
+ else
329
+ raise Machinery::Errors::ExportFailed.new(
330
+ "The systemd unit state #{service.state} is unknown."
331
+ )
333
332
  end
334
-
335
- else
336
- raise "Unsupported init system: #{init_system.inspect}."
333
+ end
334
+ else
335
+ Machinery::Ui.warn(
336
+ "Warning: Containers do not have an init system, so the default service" \
337
+ " configuration provided by the packages will be used for the image."
338
+ )
337
339
  end
338
340
  end
339
341
  end