foreman_remote_execution 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +13 -5
  2. data/app/assets/javascripts/template_invocation.js +13 -0
  3. data/app/controllers/job_invocations_controller.rb +2 -0
  4. data/app/helpers/remote_execution_helper.rb +11 -0
  5. data/app/models/concerns/foreman_remote_execution/errors_flattener.rb +62 -0
  6. data/app/models/job_invocation.rb +13 -4
  7. data/app/models/job_invocation_api_composer.rb +8 -1
  8. data/app/models/targeting.rb +4 -0
  9. data/app/models/template_invocation.rb +10 -3
  10. data/app/models/template_invocation_input_value.rb +1 -1
  11. data/app/views/job_invocations/_host_actions_td.html.erb +3 -0
  12. data/app/views/job_invocations/_host_provider_td.html.erb +3 -0
  13. data/app/views/job_invocations/_host_status_td.html.erb +1 -0
  14. data/app/views/job_invocations/_tab_hosts.html.erb +29 -11
  15. data/app/views/job_invocations/show.html.erb +6 -6
  16. data/app/views/job_invocations/show.js.erb +17 -1
  17. data/doc/public/404.html +101 -0
  18. data/doc/public/atom.xml +15 -0
  19. data/doc/public/design/design.pml +159 -0
  20. data/doc/public/design/design.png +0 -0
  21. data/doc/public/design/index.html +1034 -0
  22. data/doc/public/images/plantuml/0afe1cad9989f8eeb83d64ddd8ad966b.png +0 -0
  23. data/doc/public/images/plantuml/1b3aebc565b29cbfc24e17bb82e1755f.png +0 -0
  24. data/doc/public/images/plantuml/22d999e1bab9125ee2bee01061a0613d.png +0 -0
  25. data/doc/public/images/plantuml/37a3d54b72b5fb424c66f20823096b45.png +0 -0
  26. data/doc/public/images/plantuml/3d5233cf81d5b4e7ff1a0cb83ff8dd3c.png +0 -0
  27. data/doc/public/images/plantuml/85afad842176d44784ab10b21523523a.png +0 -0
  28. data/doc/public/images/plantuml/c06658361624b9745f8c30b3adab8d55.png +0 -0
  29. data/doc/public/images/plantuml/c3f37e9cedeb193116d385903ac5f4ec.png +0 -0
  30. data/doc/public/images/plantuml/c3f94a3f18228ce7b36d0660912c120a.png +0 -0
  31. data/doc/public/images/plantuml/cafad29b096c88cfd52b039c721138e8.png +0 -0
  32. data/doc/public/images/plantuml/ea3d02987c95f57c24dbdcae663f3d04.png +0 -0
  33. data/doc/public/images/plantuml/f1836392f5e62d2b20c7e4ba87865dfd.png +0 -0
  34. data/doc/public/images/plantuml/f4af9732163057c0b67bdc611f22c8c0.png +0 -0
  35. data/doc/public/images/plantuml/f658ac705f379599a491287b25604faa.png +0 -0
  36. data/doc/public/index.html +89 -0
  37. data/doc/public/static/css/bootstrap-responsive.min.css +9 -0
  38. data/doc/public/static/css/bootstrap.min.css +866 -0
  39. data/doc/public/static/css/jquery.tocify.css +128 -0
  40. data/doc/public/static/css/style.css +285 -0
  41. data/doc/public/static/css/syntax.css +60 -0
  42. data/doc/public/static/images/foreman.png +0 -0
  43. data/doc/public/static/images/glyphicons-halflings-white.png +0 -0
  44. data/doc/public/static/images/glyphicons-halflings.png +0 -0
  45. data/doc/public/static/js/bootstrap.min.js +7 -0
  46. data/doc/public/static/js/jquery-ui-1.9.2.custom.min.js +6 -0
  47. data/doc/public/static/js/jquery.js +2 -0
  48. data/doc/public/static/js/jquery.tocify.min.js +3 -0
  49. data/doc/public/static/js/scroll.js +24 -0
  50. data/doc/tmp/images/plantuml/048413aa0ebe983d6d4c8b723d44ef54.png +0 -0
  51. data/doc/tmp/images/plantuml/058267eeb70d4349b612d467c60f8f14.png +0 -0
  52. data/doc/tmp/images/plantuml/09a2e6a267933b8e8c2279a0aafa9552.png +0 -0
  53. data/doc/tmp/images/plantuml/09a756ef3ceb8f5f90b22c59a3363efb.png +0 -0
  54. data/doc/tmp/images/plantuml/0a4171455a0c5af78de5794e3728a152.png +0 -0
  55. data/doc/tmp/images/plantuml/0afe1cad9989f8eeb83d64ddd8ad966b.png +0 -0
  56. data/doc/tmp/images/plantuml/0b197179e1818607f0286eaf824274ac.png +0 -0
  57. data/doc/tmp/images/plantuml/0b593326b50006bd521b5e5cca3604b3.png +0 -0
  58. data/doc/tmp/images/plantuml/0b884643df43305b1506c084a54f7d62.png +0 -0
  59. data/doc/tmp/images/plantuml/0bf587f8eb742566e15f05ada951fcf3.png +0 -0
  60. data/doc/tmp/images/plantuml/0cd39df66435b755c12e7f691f89ccb9.png +0 -0
  61. data/doc/tmp/images/plantuml/12f54e758726d7c77c2d7734618ade9b.png +0 -0
  62. data/doc/tmp/images/plantuml/151c158cf5e99816811684f1f7af4add.png +0 -0
  63. data/doc/tmp/images/plantuml/1521fcbd2bb979ee2dd2cd86df6b4a4c.png +0 -0
  64. data/doc/tmp/images/plantuml/16aebbe8eb0ca9ed26fbd3ea2a7cb704.png +0 -0
  65. data/doc/tmp/images/plantuml/1b3aebc565b29cbfc24e17bb82e1755f.png +0 -0
  66. data/doc/tmp/images/plantuml/1b3c153aa58dd2c5b70603ae29268b42.png +0 -0
  67. data/doc/tmp/images/plantuml/1ddbe7dfddb328821a68a786de29d2cc.png +0 -0
  68. data/doc/tmp/images/plantuml/2082b2c3d29c6b4ab2f757f5efed5cf8.png +0 -0
  69. data/doc/tmp/images/plantuml/21833320c937cbc514f1c1248ca7d4db.png +0 -0
  70. data/doc/tmp/images/plantuml/22d999e1bab9125ee2bee01061a0613d.png +0 -0
  71. data/doc/tmp/images/plantuml/22e29148dc9824f3e0cc3d9c58591923.png +0 -0
  72. data/doc/tmp/images/plantuml/244893af77c602647475415cc99e481d.png +0 -0
  73. data/doc/tmp/images/plantuml/244af716a7f432ebe016cb4182617efc.png +0 -0
  74. data/doc/tmp/images/plantuml/26684bb52065f9727d2333f7a7cd6de9.png +0 -0
  75. data/doc/tmp/images/plantuml/271444cd542bae5faa48a9d6188e7016.png +0 -0
  76. data/doc/tmp/images/plantuml/27344a60dad90d0f298dd5c4cd4d93f0.png +0 -0
  77. data/doc/tmp/images/plantuml/280625d6da4746b3b2d3303029d5fc4f.png +0 -0
  78. data/doc/tmp/images/plantuml/289ec5cf505c6dc6e58d4581aef813fe.png +0 -0
  79. data/doc/tmp/images/plantuml/28fe7ea8ff31ec776c470ddba9465488.png +0 -0
  80. data/doc/tmp/images/plantuml/2911c81d093198df67454fae05026221.png +0 -0
  81. data/doc/tmp/images/plantuml/2aba8300fb9c286bae4761d2bdb7a856.png +0 -0
  82. data/doc/tmp/images/plantuml/2b4f2436047875223ff9217259e75eb9.png +0 -0
  83. data/doc/tmp/images/plantuml/2b6d5b3236658251a0f37b3c5b1213b1.png +0 -0
  84. data/doc/tmp/images/plantuml/2c8c0b91888b0312eb75c4652548ed9b.png +0 -0
  85. data/doc/tmp/images/plantuml/2c9447bd16be8887bee0536dac95cef6.png +0 -0
  86. data/doc/tmp/images/plantuml/2fc1023e86f067275073e41f12ae52d4.png +0 -0
  87. data/doc/tmp/images/plantuml/2fda3d4d4e80f49622f759fcc9e57fd1.png +0 -0
  88. data/doc/tmp/images/plantuml/33b3f0ba0e98a1ef3005a4d2d2736137.png +0 -0
  89. data/doc/tmp/images/plantuml/3661b2e20356651b79c50c347c791f11.png +0 -0
  90. data/doc/tmp/images/plantuml/37a3d54b72b5fb424c66f20823096b45.png +0 -0
  91. data/doc/tmp/images/plantuml/37af5b8d47aad5fda54758685a85926c.png +0 -0
  92. data/doc/tmp/images/plantuml/3972ae58834f466ccee2b403487c6b0b.png +0 -0
  93. data/doc/tmp/images/plantuml/3a465f203961262224ed05be8a69eed5.png +0 -0
  94. data/doc/tmp/images/plantuml/3d191f8c61d742c60b9c27c5a4afd231.png +0 -0
  95. data/doc/tmp/images/plantuml/3d5233cf81d5b4e7ff1a0cb83ff8dd3c.png +0 -0
  96. data/doc/tmp/images/plantuml/3d6f85d2d931ded5ecae64f2bc89c11a.png +0 -0
  97. data/doc/tmp/images/plantuml/3de6b456b9fae31dde8f8d65dc965a0b.png +0 -0
  98. data/doc/tmp/images/plantuml/3f250c15112d48b6364791c0d3e00fb4.png +0 -0
  99. data/doc/tmp/images/plantuml/40c71a2b081db9c25ff88fda3fb8485d.png +0 -0
  100. data/doc/tmp/images/plantuml/45599cee5eb08d0a3950625d5ec3926a.png +0 -0
  101. data/doc/tmp/images/plantuml/497445a1debfcc5c52fe92b94305ccb7.png +0 -0
  102. data/doc/tmp/images/plantuml/4bbaa7bb555b0c4594f6d6d15825518d.png +0 -0
  103. data/doc/tmp/images/plantuml/4db606c9f871c96e361709f299223fc6.png +0 -0
  104. data/doc/tmp/images/plantuml/51eab226644fbfdb90d771c82c2d32e7.png +0 -0
  105. data/doc/tmp/images/plantuml/56eb220f166aaec84e573d393f21441a.png +0 -0
  106. data/doc/tmp/images/plantuml/5989a2986aa2641cf6b7a251082b0ed5.png +0 -0
  107. data/doc/tmp/images/plantuml/5f1a066b1d50befe6fadc45f10625dfe.png +0 -0
  108. data/doc/tmp/images/plantuml/61f9c2c4b9984de108a2198d8f779c0c.png +0 -0
  109. data/doc/tmp/images/plantuml/621822e563b5766a3d59897d19df8713.png +0 -0
  110. data/doc/tmp/images/plantuml/64f5b6d463af5ade70cfa17ba657c3f1.png +0 -0
  111. data/doc/tmp/images/plantuml/67ff01dde24e12f82a8e999d571958be.png +0 -0
  112. data/doc/tmp/images/plantuml/6b249a571b18352445467823e93ac3d5.png +0 -0
  113. data/doc/tmp/images/plantuml/6c5529902d6fb5d7db3b0007afedebc7.png +0 -0
  114. data/doc/tmp/images/plantuml/6cc111c35c0814efa0a9a191181e1200.png +0 -0
  115. data/doc/tmp/images/plantuml/6f0a6390ef7b3356e38a6fa6bba96e15.png +0 -0
  116. data/doc/tmp/images/plantuml/711b546eed61e45999c8b1fb84023529.png +0 -0
  117. data/doc/tmp/images/plantuml/712ec401d83fa8795c9c1b0eae016aad.png +0 -0
  118. data/doc/tmp/images/plantuml/73ae8c3303bc976f248a36e0c9b0c9a1.png +0 -0
  119. data/doc/tmp/images/plantuml/748444baf352084db872b0907a5d4e05.png +0 -0
  120. data/doc/tmp/images/plantuml/7516cd6e6a0d1b88ae213a6783ed1fad.png +0 -0
  121. data/doc/tmp/images/plantuml/76172d21de8c809c7c93b1e57198f327.png +0 -0
  122. data/doc/tmp/images/plantuml/7a958293f7a810646f4996e69d5c539e.png +0 -0
  123. data/doc/tmp/images/plantuml/7b9e4cd6ddfab153267f4e76ef71a8d7.png +0 -0
  124. data/doc/tmp/images/plantuml/7c9165a218b29a6d1e35c01a8a034a62.png +0 -0
  125. data/doc/tmp/images/plantuml/7ce9d3a0abf7c8bdae44e8078df89d3a.png +0 -0
  126. data/doc/tmp/images/plantuml/7f04522bca62dda77dbae9f6d6fa0c03.png +0 -0
  127. data/doc/tmp/images/plantuml/7fe1802627ae83d228dd02fb258e1e2a.png +0 -0
  128. data/doc/tmp/images/plantuml/805c9e1236d9a8ae5a084bc4ea5c4986.png +0 -0
  129. data/doc/tmp/images/plantuml/842b17abcd4a5f154837fa1682574ec1.png +0 -0
  130. data/doc/tmp/images/plantuml/85afad842176d44784ab10b21523523a.png +0 -0
  131. data/doc/tmp/images/plantuml/864507c1788f9f4d995cf2f9a4d5c6f8.png +0 -0
  132. data/doc/tmp/images/plantuml/8706e05f1d3ef4fb5bd6eb104c9c7bd1.png +0 -0
  133. data/doc/tmp/images/plantuml/88fd0980f15b8b15898172ba05aaa41f.png +0 -0
  134. data/doc/tmp/images/plantuml/8d17e36f709592799543d492c740f536.png +0 -0
  135. data/doc/tmp/images/plantuml/8d99db858d323a4d28a800c24d69321e.png +0 -0
  136. data/doc/tmp/images/plantuml/8fb41bf0ac7f49a037f28c7188982a21.png +0 -0
  137. data/doc/tmp/images/plantuml/90692212f6fa45bebff1c098f59081d4.png +0 -0
  138. data/doc/tmp/images/plantuml/921cfd5e27136bc11a05da16d87ec5e1.png +0 -0
  139. data/doc/tmp/images/plantuml/92ca26960a9e4d2dbc9e5099d0d9aa47.png +0 -0
  140. data/doc/tmp/images/plantuml/92f06afd5a5fce9b76f46d0f2a4301c8.png +0 -0
  141. data/doc/tmp/images/plantuml/9401b435b322426270569cfead3aaec6.png +0 -0
  142. data/doc/tmp/images/plantuml/964570783a5e6f760039695567799251.png +0 -0
  143. data/doc/tmp/images/plantuml/96bd58456219af9a60cc68323d3e42e1.png +0 -0
  144. data/doc/tmp/images/plantuml/98e94e848a193d0278890233f2d43aaa.png +0 -0
  145. data/doc/tmp/images/plantuml/9a40b332e4c2775ae08163ea68fccaae.png +0 -0
  146. data/doc/tmp/images/plantuml/a134bf02dcd57358aca553be5427cc8d.png +0 -0
  147. data/doc/tmp/images/plantuml/a3dd22bc181ea18e0270cc38d299c64e.png +0 -0
  148. data/doc/tmp/images/plantuml/a6f86e5ab17a4b01984e131552ba9d2d.png +0 -0
  149. data/doc/tmp/images/plantuml/a89e5c53f9c64a2d50d28011b16eeca8.png +0 -0
  150. data/doc/tmp/images/plantuml/ab99822b7b6d395f02025fc294acdbf6.png +0 -0
  151. data/doc/tmp/images/plantuml/ac3250afab3a13ac5a9fe26d3fa76f4e.png +0 -0
  152. data/doc/tmp/images/plantuml/aeef134198459523e8ce5ca546e05bd9.png +0 -0
  153. data/doc/tmp/images/plantuml/af1d95b2618fd3b925100f3ed30cae1f.png +0 -0
  154. data/doc/tmp/images/plantuml/af65578ed6bf4754899c00fc937a9ca7.png +0 -0
  155. data/doc/tmp/images/plantuml/b502ecd2b04efe6d65d5ab4f42529723.png +0 -0
  156. data/doc/tmp/images/plantuml/b5775ac7d4be15c8d1d4dc916c57b1fc.png +0 -0
  157. data/doc/tmp/images/plantuml/b5d351333c33e237e975e416665c45f6.png +0 -0
  158. data/doc/tmp/images/plantuml/b65b5a9f2110e85fe657fd34a7d4e914.png +0 -0
  159. data/doc/tmp/images/plantuml/b7fe7bc142c939ab06a0457b20d15c75.png +0 -0
  160. data/doc/tmp/images/plantuml/ba43bac82453feba943d5c1daea6631f.png +0 -0
  161. data/doc/tmp/images/plantuml/ba53dcf3a4cffbf21843b4832c205ba8.png +0 -0
  162. data/doc/tmp/images/plantuml/bc11747b6e90ad5983be919d312a94fe.png +0 -0
  163. data/doc/tmp/images/plantuml/bda113efbc8950f52d6025f4c2566dce.png +0 -0
  164. data/doc/tmp/images/plantuml/be01cbbb3b421294fd727b375fb0d6e5.png +0 -0
  165. data/doc/tmp/images/plantuml/be93da05489725928bf0366658baadb6.png +0 -0
  166. data/doc/tmp/images/plantuml/bfce7af69eec0df8b52740af0645c31f.png +0 -0
  167. data/doc/tmp/images/plantuml/c054b73ffa0504758ea4eb0c7dc8ca81.png +0 -0
  168. data/doc/tmp/images/plantuml/c0626bf19526c0962d595925438e9673.png +0 -0
  169. data/doc/tmp/images/plantuml/c06658361624b9745f8c30b3adab8d55.png +0 -0
  170. data/doc/tmp/images/plantuml/c3b98674c79ce06ee0769dcbaa9d94c3.png +0 -0
  171. data/doc/tmp/images/plantuml/c3d72dde65d5101037047b98c6cb818d.png +0 -0
  172. data/doc/tmp/images/plantuml/c3f37e9cedeb193116d385903ac5f4ec.png +0 -0
  173. data/doc/tmp/images/plantuml/c3f94a3f18228ce7b36d0660912c120a.png +0 -0
  174. data/doc/tmp/images/plantuml/c58114cfff1f79e4bd5745c19abb7b0a.png +0 -0
  175. data/doc/tmp/images/plantuml/c94423daecb58043ed4a2d03eb9e7fbb.png +0 -0
  176. data/doc/tmp/images/plantuml/c9f310ef5b79590646b80dc981fa5e57.png +0 -0
  177. data/doc/tmp/images/plantuml/ca3a0f9122751ad0979be05a573a6608.png +0 -0
  178. data/doc/tmp/images/plantuml/cafad29b096c88cfd52b039c721138e8.png +0 -0
  179. data/doc/tmp/images/plantuml/cb29a529eb88b13ff4f8f063b54135c8.png +0 -0
  180. data/doc/tmp/images/plantuml/cb5c68d0f0ff412347978b498e5673c2.png +0 -0
  181. data/doc/tmp/images/plantuml/cc33b6eaa2f4035b4b4dbbc56b1b5727.png +0 -0
  182. data/doc/tmp/images/plantuml/cd8243645f8d93d6f2578a1b08b6f423.png +0 -0
  183. data/doc/tmp/images/plantuml/cda431cfd134c2e8ed1d99955df2847c.png +0 -0
  184. data/doc/tmp/images/plantuml/ce6e23abaa619800bda4724d32c5b174.png +0 -0
  185. data/doc/tmp/images/plantuml/cf4c537923c278133d9584f5cb30257b.png +0 -0
  186. data/doc/tmp/images/plantuml/cf5dfb9db2c8a84071e0615e4aa6a17f.png +0 -0
  187. data/doc/tmp/images/plantuml/cfe17537e2e1bd3339ecf69538b1bedf.png +0 -0
  188. data/doc/tmp/images/plantuml/d029ad0926f2d7017652f8806cceecf5.png +0 -0
  189. data/doc/tmp/images/plantuml/d34e8760198c9bb5b2452b2982ae8797.png +0 -0
  190. data/doc/tmp/images/plantuml/d4774af1e3f76853eab95959ad4e0e08.png +0 -0
  191. data/doc/tmp/images/plantuml/d55d250a9ae94d2242570689bcde2bd7.png +0 -0
  192. data/doc/tmp/images/plantuml/d5a5326ed3240acd44d98f6545d9666b.png +0 -0
  193. data/doc/tmp/images/plantuml/da292996f3b3552d5def31282a728aa6.png +0 -0
  194. data/doc/tmp/images/plantuml/dc3a1b0baa6db1cab59eedbfb8e6af75.png +0 -0
  195. data/doc/tmp/images/plantuml/dd7c64391b456f5eaab7eff30f211890.png +0 -0
  196. data/doc/tmp/images/plantuml/dd7f0c2542cddecaff7d00177ffc7895.png +0 -0
  197. data/doc/tmp/images/plantuml/dd902c7d5084f0c402ce75a544d7197d.png +0 -0
  198. data/doc/tmp/images/plantuml/df6507a5cb7e9f9fe4203669e758a918.png +0 -0
  199. data/doc/tmp/images/plantuml/e3407a41d8da8f9d699cb8142a0d777f.png +0 -0
  200. data/doc/tmp/images/plantuml/e38fc5cd0e5eb7f29cca7c367f500ea2.png +0 -0
  201. data/doc/tmp/images/plantuml/e75ceb1ce105508b5219c35b7dda63c4.png +0 -0
  202. data/doc/tmp/images/plantuml/e92887836f3471bbb60d5811a4f56d3c.png +0 -0
  203. data/doc/tmp/images/plantuml/ea03a745369cb2849c041b5ebf0b30ed.png +0 -0
  204. data/doc/tmp/images/plantuml/ea3d02987c95f57c24dbdcae663f3d04.png +0 -0
  205. data/doc/tmp/images/plantuml/ea972643782c0ac7abf5b1ae6ae666ed.png +0 -0
  206. data/doc/tmp/images/plantuml/ed437670bf13bdb12bc79b4bccbdd2d3.png +0 -0
  207. data/doc/tmp/images/plantuml/ed5834a2cc5ae4c19d37a49963ba2149.png +0 -0
  208. data/doc/tmp/images/plantuml/edc4fd9652deda112f17db2861588d83.png +0 -0
  209. data/doc/tmp/images/plantuml/f0bbb549ad5634ca0f1d09f89bde3364.png +0 -0
  210. data/doc/tmp/images/plantuml/f0e610accad41289c5f984fe72148d12.png +0 -0
  211. data/doc/tmp/images/plantuml/f1836392f5e62d2b20c7e4ba87865dfd.png +0 -0
  212. data/doc/tmp/images/plantuml/f2f65926bbdde9e1e80d44ee633ed98d.png +0 -0
  213. data/doc/tmp/images/plantuml/f4098f2c227db897eb4dc67bb4842200.png +0 -0
  214. data/doc/tmp/images/plantuml/f4af9732163057c0b67bdc611f22c8c0.png +0 -0
  215. data/doc/tmp/images/plantuml/f658ac705f379599a491287b25604faa.png +0 -0
  216. data/doc/tmp/images/plantuml/f72930a4d8c5d8d5e95cd3c99687e14b.png +0 -0
  217. data/doc/tmp/images/plantuml/f754b731d8ea2c1764363570b78defcb.png +0 -0
  218. data/doc/tmp/images/plantuml/f90e4db6e7f787dd9833be86854125a3.png +0 -0
  219. data/doc/tmp/images/plantuml/f942161223c00f35e38950be1b12beac.png +0 -0
  220. data/doc/tmp/images/plantuml/fa54e9771c4537d1e8e0103de6865f15.png +0 -0
  221. data/doc/tmp/images/plantuml/fb777bb04ce1e2a8e5b9a345dd199aa7.png +0 -0
  222. data/doc/tmp/images/plantuml/fbf8cbe3aa6a95ad4c90d5596c769f34.png +0 -0
  223. data/doc/tmp/images/plantuml/fbf9f7958bc1d1f6f9ae966791e9c11b.png +0 -0
  224. data/lib/foreman_remote_execution/version.rb +1 -1
  225. data/test/unit/job_invocation_api_composer_test.rb +36 -10
  226. data/test/unit/targeting_test.rb +13 -0
  227. metadata +471 -52
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f7b17c729ed77837816fc91f385aec89be98be24
4
- data.tar.gz: 32d6a582df1ffb8e3d20163481176e651070127e
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NWE1NDJlYTY5N2UyNDEyYmVmNzBlMzRhYzAxOGYwMTM1ZWU0NjIyZg==
5
+ data.tar.gz: !binary |-
6
+ ZDNiN2JhOGU3NTJiMTJjNGRmZGU5Mjc3OTM0YmM0Yzk5YWMyYzJkYQ==
5
7
  SHA512:
6
- metadata.gz: 733f0235a691db6d71bc9ad72bcf1d3c45db6c95530ed9a57d39203d59401b92858ffb9954c2dccba622ae5a3819147fae35415a1073e1cb920fb138ef89ef46
7
- data.tar.gz: 35cfdf9e050b3ebe132c955c0f21c41fbd97e33a3dee871f52e556b446a6d64625b66b0c558bd5d01a23465695b0a1cb233d2e39d5ac3f43c48e5aa6793e3d62
8
+ metadata.gz: !binary |-
9
+ ZWY2MmU2NjU2MjQxYjZmYjM1NGJjNDIzODE2NzlkMjlhYjVmM2QyYmY1Yzk1
10
+ MWJmYWVmNzQ0OTIwOTIxYmEyYjE4NTliNTAzMTk4NTA1NGMwMzc0N2M4OTMx
11
+ MzZiODQ1ZmYwMDk3NzE4ZGU3MmExYjE4NmYyNmY4MTAwMThiYmM=
12
+ data.tar.gz: !binary |-
13
+ Mjc1NDY5OWVhNjEwNTVhNTQ3YTNlNWM1NTQ2NWMzZGQzZWIwZWRiMzdkMWJh
14
+ MmUxY2I0MjlkYWUxNzBhNjQ4MDNmZjU0MjkzMjhjNGExMjE5NmNmNzJhOTc4
15
+ ZjhjYzY3NjYxMDU1N2UzMGRhZWEyZDExMjg0NTBmNmQ0NTg3ZjI=
@@ -57,3 +57,16 @@ function delayed_refresh(url, data){
57
57
  )
58
58
  }, 1000);
59
59
  }
60
+
61
+ function job_invocation_refresh_data(){
62
+ return {
63
+ hosts_needs_refresh: $("div#hosts").data('refresh_required'),
64
+ host_ids_needing_status_update: fetch_ids_of_hosts('status'),
65
+ host_ids_needing_provider_update: fetch_ids_of_hosts('provider'),
66
+ host_ids_needing_actions_update: fetch_ids_of_hosts('actions')
67
+ }
68
+ }
69
+
70
+ function fetch_ids_of_hosts(attribute){
71
+ return _.map($('div#hosts td.host_' + attribute + '[data-refresh_required="true"]'), function(elem) { return $(elem).data('id') });
72
+ }
@@ -43,6 +43,8 @@ class JobInvocationsController < ApplicationController
43
43
  def show
44
44
  @job_invocation = resource_base.find(params[:id])
45
45
  @auto_refresh = @job_invocation.last_task.try(:pending?)
46
+ hosts_base = @job_invocation.targeting.hosts.authorized(:view_hosts, Host)
47
+ @hosts = hosts_base.search_for(params[:search], :order => params[:order] || 'name ASC').paginate(:page => params[:page])
46
48
  end
47
49
 
48
50
  def index
@@ -158,4 +158,15 @@ module RemoteExecutionHelper
158
158
  :text => renderer.error_message.html_safe
159
159
  end
160
160
  end
161
+
162
+ def job_invocation_active_tab(tab, params)
163
+ active = 'active'
164
+ inactive = ''
165
+ hosts_tab_active = params[:page].present? || params[:search].present? || params[:order].present?
166
+ if hosts_tab_active
167
+ tab == :hosts ? active : inactive
168
+ else
169
+ tab == :overview ? active : inactive
170
+ end
171
+ end
161
172
  end
@@ -0,0 +1,62 @@
1
+ module ForemanRemoteExecution
2
+ module ErrorsFlattener
3
+ def flattened_validation_exception
4
+ ActiveRecord::RecordNotSaved.new(I18n.t("activerecord.errors.messages.record_invalid", :errors => flattened_errors.join(', ')))
5
+ end
6
+
7
+ def flattened_errors
8
+ errors = Hash.new { |h, k| h[k] = [] }
9
+ self.errors.keys.each do |key|
10
+ messages = self.errors[key]
11
+ invalid_objects = invalid_objects_for_attribute(key)
12
+ if invalid_objects.blank?
13
+ errors[key] = messages
14
+ else
15
+ invalid_objects.each do |invalid_object|
16
+ errors.merge!(sub_object_errors(key, invalid_object, messages))
17
+ end
18
+ end
19
+ end
20
+ errors.map { |key, messages| self.errors.full_message(key, messages.join(', ')) }
21
+ end
22
+
23
+ private
24
+
25
+ def invalid_objects_for_attribute(attribute)
26
+ if self.respond_to?(attribute)
27
+ invalid_object = self.public_send(attribute)
28
+ if invalid_object.is_a? Enumerable
29
+ invalid_object.select { |o| o.respond_to?(:invalid?) && o.invalid? }
30
+ else
31
+ [invalid_object]
32
+ end
33
+ end
34
+ end
35
+
36
+ def flattened_error_key(key, object)
37
+ mapping = if defined? self.class::FLATTENED_ERRORS_MAPPING
38
+ self.class::FLATTENED_ERRORS_MAPPING
39
+ else
40
+ {}
41
+ end
42
+ mapped_key = mapping.fetch(key, key)
43
+ if mapped_key.is_a? Proc
44
+ mapped_key.call(object)
45
+ else
46
+ mapped_key
47
+ end
48
+ end
49
+
50
+ def sub_object_errors(key, object, original_message)
51
+ key = flattened_error_key(key, object)
52
+ errors = if object.respond_to? :flattened_errors
53
+ object.flattened_errors
54
+ elsif object.respond_to? :errors
55
+ object.errors.full_messages
56
+ else
57
+ original_message
58
+ end
59
+ return { "#{key}:" => errors }
60
+ end
61
+ end
62
+ end
@@ -1,6 +1,11 @@
1
1
  class JobInvocation < ActiveRecord::Base
2
2
  include Authorizable
3
3
 
4
+ include ForemanRemoteExecution::ErrorsFlattener
5
+ FLATTENED_ERRORS_MAPPING = { :template_invocations => lambda do |template_invocation|
6
+ _("template") + " #{template_invocation.template.name}"
7
+ end }
8
+
4
9
  belongs_to :targeting, :dependent => :destroy
5
10
  has_many :template_invocations, :inverse_of => :job_invocation, :dependent => :destroy
6
11
 
@@ -10,7 +15,7 @@ class JobInvocation < ActiveRecord::Base
10
15
 
11
16
  scoped_search :on => :job_name
12
17
 
13
- delegate :bookmark, :to => :targeting, :allow_nil => true
18
+ delegate :bookmark, :resolved?, :to => :targeting, :allow_nil => true
14
19
 
15
20
  include ForemanTasks::Concerns::ActionSubject
16
21
 
@@ -51,10 +56,10 @@ class JobInvocation < ActiveRecord::Base
51
56
  end
52
57
 
53
58
  def total_hosts_count
54
- if targeting.resolved_at.nil?
55
- _('N/A')
56
- else
59
+ if targeting.resolved?
57
60
  targeting.hosts.count
61
+ else
62
+ _('N/A')
58
63
  end
59
64
  end
60
65
 
@@ -109,4 +114,8 @@ class JobInvocation < ActiveRecord::Base
109
114
  def available_providers(host)
110
115
  return RemoteExecutionProvider.provider_names
111
116
  end
117
+
118
+ def sub_task_for_host(host)
119
+ sub_tasks.joins(:locks).where("#{ForemanTasks::Lock.table_name}.resource_type" => 'Host::Managed', "#{ForemanTasks::Lock.table_name}.resource_id" => host.id).first
120
+ end
112
121
  end
@@ -4,7 +4,6 @@ class JobInvocationApiComposer
4
4
  delegate :job_name, :to => :job_invocation
5
5
  delegate :targeting, :to => :job_invocation
6
6
  delegate :template_invocations, :to => :job_invocation
7
- delegate :save!, :to => :job_invocation
8
7
 
9
8
  def initialize(job_invocation, user, params)
10
9
  @job_invocation = job_invocation
@@ -56,6 +55,14 @@ class JobInvocationApiComposer
56
55
  targeting.valid? & job_invocation.valid? & template_invocations.all?(&:valid?)
57
56
  end
58
57
 
58
+ def save!
59
+ if valid?
60
+ job_invocation.save!
61
+ else
62
+ raise job_invocation.flattened_validation_exception
63
+ end
64
+ end
65
+
59
66
  def available_bookmarks
60
67
  Bookmark.authorized(:view_bookmarks).my_bookmarks
61
68
  end
@@ -42,6 +42,10 @@ class Targeting < ActiveRecord::Base
42
42
  ids.map { |id| "name = #{hosts[id].first.name}" }.join(' or ')
43
43
  end
44
44
 
45
+ def resolved?
46
+ self.resolved_at.present?
47
+ end
48
+
45
49
  private
46
50
 
47
51
  def bookmark_or_query_is_present
@@ -1,6 +1,12 @@
1
1
  class TemplateInvocation < ActiveRecord::Base
2
2
  include ForemanTasks::Concerns::ActionSubject
3
3
 
4
+ include ForemanRemoteExecution::ErrorsFlattener
5
+ FLATTENED_ERRORS_MAPPING = { :input_values => lambda do |input_value|
6
+ _("Input") + " #{input_value.template_input.name}"
7
+ end }
8
+
9
+
4
10
  belongs_to :template, :class_name => 'JobTemplate', :foreign_key => 'template_id'
5
11
  belongs_to :job_invocation, :inverse_of => :template_invocations
6
12
  has_many :input_values, :class_name => 'TemplateInvocationInputValue', :dependent => :destroy
@@ -16,9 +22,10 @@ class TemplateInvocation < ActiveRecord::Base
16
22
  private
17
23
 
18
24
  def provides_required_input_values
19
- required_input_ids = self.template.template_inputs.where(:required => true).pluck(:id)
20
- unless (required_input_ids - self.input_values.map(&:template_input_id)).empty?
21
- errors.add(:base, _("Not all required inputs have values."))
25
+ required_inputs = self.template.template_inputs.where(:required => true)
26
+ missing_inputs = required_inputs.reject { |input| self.input_values.map(&:template_input_id).include?(input.id) }
27
+ unless missing_inputs.empty?
28
+ errors.add(:base, _("Not all required inputs have values. Missing inputs: %s") % missing_inputs.map(&:name).join(', '))
22
29
  end
23
30
  end
24
31
  end
@@ -3,7 +3,7 @@ class TemplateInvocationInputValue < ActiveRecord::Base
3
3
  belongs_to :template_invocation
4
4
  belongs_to :template_input
5
5
 
6
- validates :value, :presence => true
6
+ validates :value, :presence => true, :if => proc { |v| v.template_input.required? || v.value.nil? }
7
7
 
8
8
  validates :value, :inclusion => { :in => proc { |v| v.template_input.options_array } },
9
9
  :if => proc { |v| v.template_input.input_type == 'user' && v.template_input.options_array.present? }
@@ -0,0 +1,3 @@
1
+ <td class="host_actions" id="<%= dom_id(host) %>-actions" data-refresh_required="<%= task.nil? ? 'true' : '' %>" data-id="<%= host.id %>">
2
+ <%= action_buttons(template_invocation_actions(task, host)) %>
3
+ </td>
@@ -0,0 +1,3 @@
1
+ <td class="host_provider" id="<%= dom_id(host) %>-provider" data-refresh_required="<%= task.nil? ? 'true' : '' %>" data-id="<%= host.id %>">
2
+ <%= remote_execution_provider_for(task) %>
3
+ </td>
@@ -0,0 +1 @@
1
+ <td class="host_status" id="<%= dom_id(host) %>-status" data-refresh_required="<%= task.nil? || task.pending? ? 'true' : '' %>" data-id="<%= host.id %>"><%= template_invocation_status(task) %></td>
@@ -1,8 +1,24 @@
1
- <% if job_invocation.targeting.resolved_at %>
1
+ <% if job_invocation.resolved? %>
2
+ <%= form_tag job_invocation_path(job_invocation), :method => "get",:id =>"search-form" do %>
3
+ <div class="row">
4
+ <div class="title_filter col-md-6">
5
+ <div class="input-group">
6
+ <%= auto_complete_search(:search, params[:search].try(:squeeze, " "), :placeholder => _("Filter") + ' ...', :path => hosts_path) %>
7
+ <span class="input-group-btn">
8
+ <button class="btn btn-default" type="submit">
9
+ <%= icon_text("search", content_tag(:span, _("Search"), :class => "hidden-xs")) %>
10
+ </button>
11
+ </span>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ <% end %>
16
+ <br>
17
+
2
18
  <table class="table table-bordered table-striped table-condensed">
3
19
  <thead>
4
20
  <tr>
5
- <th><%= _('Host') %></th>
21
+ <th><%= sort :name, :as => _('Host') %></th>
6
22
  <th><%= _('Provider') %></th>
7
23
  <th><%= _('Status') %></th>
8
24
  <th><%= _('Actions') %></th>
@@ -10,17 +26,19 @@
10
26
  </thead>
11
27
 
12
28
  <tbody>
13
- <% job_invocation.targeting.hosts.each do |host| %>
14
- <tr>
15
- <% task = job_invocation.sub_tasks.joins(:locks).where("#{ForemanTasks::Lock.table_name}.resource_type" => 'Host::Managed', "#{ForemanTasks::Lock.table_name}.resource_id" => host.id).first %>
16
- <td><%= link_to_if_authorized host.name, hash_for_host_path(host).merge(:auth_object => host, :permission => :view_hosts) %></td>
17
- <td><%= remote_execution_provider_for(task) %></td>
18
- <td><%= template_invocation_status(task) %></td>
19
- <td><%= action_buttons(template_invocation_actions(task, host)) %></td>
20
- </tr>
21
- <% end %>
29
+ <% hosts.each do |host| %>
30
+ <% task = job_invocation.sub_task_for_host(host) %>
31
+ <tr>
32
+ <td><%= link_to_if_authorized host.name, hash_for_host_path(host).merge(:auth_object => host, :permission => :view_hosts) %></td>
33
+ <%= render('host_provider_td', :host => host, :task => task) %>
34
+ <%= render('host_status_td', :host => host, :task => task) %>
35
+ <%= render('host_actions_td', :host => host, :task => task) %>
36
+ </tr>
37
+ <% end %>
22
38
  </tbody>
23
39
  </table>
40
+
41
+ <%= will_paginate_with_info @hosts %>
24
42
  <% else %>
25
43
  <div class="alert alert-warning">
26
44
  <%= _("The dynamic query '#{job_invocation.targeting.search_query}' was not resolved yet. The list of hosts to which it would resolve now can be seen") %>
@@ -7,22 +7,22 @@
7
7
  <% end %>
8
8
 
9
9
  <ul class="nav nav-tabs" data-tabs="tabs">
10
- <li class="active"><a href="#primary" data-toggle="tab"><%= _('Overview') %></a></li>
11
- <li><a href="#hosts" data-toggle="tab"><%= _('Hosts') %></a></li>
10
+ <li class="<%= job_invocation_active_tab(:overview, params) %>"><a href="#primary" data-toggle="tab"><%= _('Overview') %></a></li>
11
+ <li class="<%= job_invocation_active_tab(:hosts, params) %>"><a href="#hosts" data-toggle="tab"><%= _('Hosts') %></a></li>
12
12
  </ul>
13
13
 
14
14
  <div class="tab-content">
15
- <div class="tab-pane active" id="primary">
15
+ <div class="tab-pane <%= job_invocation_active_tab(:overview, params) %>" id="primary">
16
16
  <%= render 'tab_overview', :job_invocation => @job_invocation %>
17
17
  </div>
18
18
 
19
- <div class="tab-pane" id="hosts">
20
- <%= render 'tab_hosts', :job_invocation => @job_invocation %>
19
+ <div class="tab-pane <%= job_invocation_active_tab(:hosts, params) %>" id="hosts" data-refresh_required="<%= @job_invocation.resolved? ? '' : 'true' %>">
20
+ <%= render 'tab_hosts', :job_invocation => @job_invocation, :hosts => @hosts %>
21
21
  </div>
22
22
  </div>
23
23
 
24
24
  <script id="job_invocation_refresh" data-refresh-url="<%= job_invocation_path(@job_invocation) %>">
25
25
  <% if @auto_refresh %>
26
- delayed_refresh($('script#job_invocation_refresh').data('refresh-url'));
26
+ delayed_refresh($('script#job_invocation_refresh').data('refresh-url'), job_invocation_refresh_data());
27
27
  <% end %>
28
28
  </script>
@@ -1,6 +1,22 @@
1
1
  $('div#status_chart').html('<%=j job_invocation_chart(@job_invocation) %>');
2
2
  $('div#status').flot_pie();
3
3
 
4
+ <% if params[:hosts_needs_refresh] == 'true' && @job_invocation.resolved? %>
5
+ var hosts_tab = $('div#hosts');
6
+ hosts_tab.html('<%=j render('tab_hosts', :job_invocation => @job_invocation, :hosts => @hosts) %>');
7
+ hosts_tab.data('refresh_required', '');
8
+ <% end %>
9
+
10
+ <% ['status', 'actions', 'provider'].each do |attribute| %>
11
+ <% if params["host_ids_needing_#{attribute}_update"].present? %>
12
+ var td_element;
13
+ <% Host.authorized(:view_hosts, Host).where(:id => params["host_ids_needing_#{attribute}_update"]).each do |host| %>
14
+ td_element= $('#<%= dom_id(host) %>-<%= attribute %>');
15
+ td_element.replaceWith('<%=j render("host_#{attribute}_td", :host => host, :task => @job_invocation.sub_task_for_host(host)) %>');
16
+ <% end %>
17
+ <% end %>
18
+ <% end %>
19
+
4
20
  <% if @auto_refresh %>
5
- delayed_refresh($('script#job_invocation_refresh').data('refresh-url'));
21
+ delayed_refresh($('script#job_invocation_refresh').data('refresh-url'), job_invocation_refresh_data());
6
22
  <% end %>
@@ -0,0 +1,101 @@
1
+ <!doctype html>
2
+ <html itemscope itemtype="http://schema.org/Organization" lang="en">
3
+ <head>
4
+ <base href="/foreman_remote_execution/">
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+ <title> :: Foreman Remote Execution</title>
13
+
14
+ <script type="text/javascript" src="/foreman_remote_execution/static/js/jquery.js"></script>
15
+ <script type="text/javascript" src="/foreman_remote_execution/static/js/bootstrap.min.js"></script>
16
+ <script type="text/javascript" src="/foreman_remote_execution/static/js/jquery-ui-1.9.2.custom.min.js"></script>
17
+ <script type="text/javascript" src="/foreman_remote_execution/static/js/jquery.tocify.min.js"></script>
18
+ <script type="text/javascript" src="/foreman_remote_execution/static/js/scroll.js"></script>
19
+
20
+ <link rel="stylesheet" media="all" href="/foreman_remote_execution/static/css/bootstrap.min.css"/>
21
+ <link rel="stylesheet" media="all" href="/foreman_remote_execution/static/css/bootstrap-responsive.min.css"/>
22
+ <link rel="stylesheet" media="all" href="/foreman_remote_execution/static/css/jquery.tocify.css"/>
23
+ <link rel="stylesheet" media="all" href="/foreman_remote_execution/static/css/syntax.css" />
24
+ <link rel="stylesheet" media="all" href="/foreman_remote_execution/static/css/style.css"/>
25
+ <meta name="apple-mobile-web-app-capable" content="yes">
26
+ <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0;" />
27
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
28
+ </head>
29
+
30
+ <body>
31
+ <div class="navbar navbar-fixed-top">
32
+ <div class="navbar-inner">
33
+ <div class="container">
34
+ <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
35
+ <span class="icon-bar"></span>
36
+ <span class="icon-bar"></span>
37
+ <span class="icon-bar"></span>
38
+ </button>
39
+ <img alt="Foreman" class="logo" src="/foreman_remote_execution/static/images/foreman.png" />
40
+ <div class="brand">
41
+ <a href="/foreman_remote_execution/">Foreman</a>
42
+ <a class="subtitle" href="/foreman_remote_execution/">Remote Execution</a>
43
+ </div>
44
+ <div class="nav-collapse collapse">
45
+ <ul class="nav">
46
+ <li><a href="/foreman_remote_execution/">About</a></li>
47
+ <li><a href="/foreman_remote_execution/design/">Design</a></li>
48
+ </ul>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ <script>
54
+ $(function(){
55
+ $('.nav > li a[href="'+window.location.pathname+'"]').parents('.nav > li').addClass('active')
56
+ })
57
+ </script>
58
+
59
+
60
+ <div id="main">
61
+ <div id="content" class="container">
62
+ <div class="row">
63
+ <div id="toc" class="span3">
64
+ </div>
65
+ <div id="doc" class="offset3 span9">
66
+ <p>We are sorry, page You are looking for does not exist :&#39;(</p>
67
+
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </div>
72
+
73
+ <script type="text/javascript">
74
+ $(function() {
75
+ //Calls the tocify method on your HTML div.
76
+ $("#toc").tocify({context: '#doc', scrollTo: '60', selectors: "h1,h2,h3"});
77
+ });
78
+ </script>
79
+
80
+ <div class="footer">
81
+ <div class="container">
82
+ <p>This web site is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_GB">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>. Source available: <a xmlns:dct="http://purl.org/dc/terms/" href="https://github.com/theforeman/theforeman.org" rel="dct:source">github/theforeman/theforeman.org</a>.</p>
83
+ <a href="https://plus.google.com/102496134326414788199" rel="publisher">Google+ community</a>
84
+ </div>
85
+ </div>
86
+
87
+ <script type="text/javascript">
88
+ var _gaq = _gaq || [];
89
+ _gaq.push(['_setAccount', 'UA-2134730-5']);
90
+ _gaq.push(['_trackPageview']);
91
+
92
+ (function() {
93
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
94
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
95
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
96
+ })();
97
+ </script>
98
+
99
+ </body>
100
+ </html>
101
+