vagrant-skytap 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (327) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/lib/vagrant-skytap/action/add_vm_to_environment.rb +4 -4
  4. data/lib/vagrant-skytap/action/compose_environment.rb +131 -0
  5. data/lib/vagrant-skytap/action/create_environment.rb +3 -1
  6. data/lib/vagrant-skytap/action/initialize_api_client.rb +6 -5
  7. data/lib/vagrant-skytap/action/set_up_vm.rb +3 -1
  8. data/lib/vagrant-skytap/action/store_extra_data.rb +4 -2
  9. data/lib/vagrant-skytap/action.rb +4 -17
  10. data/lib/vagrant-skytap/api/environment.rb +53 -25
  11. data/lib/vagrant-skytap/api/vm.rb +9 -3
  12. data/lib/vagrant-skytap/command/up.rb +46 -30
  13. data/lib/vagrant-skytap/errors.rb +4 -0
  14. data/lib/vagrant-skytap/version.rb +1 -1
  15. data/locales/en.yml +5 -1
  16. data/spec/unit/actions/compose_environment_spec.rb +101 -0
  17. data/spec/unit/environment_spec.rb +26 -45
  18. data/spec/unit/support/shared/skytap_context.rb +5 -0
  19. data/vagrant-skytap.gemspec +3 -3
  20. metadata +9 -311
  21. data/.byebug_history +0 -256
  22. data/.project +0 -11
  23. data/_patches-20160112/0 +0 -388
  24. data/_patches-20160112/1 +0 -82
  25. data/_patches-20160112/2 +0 -239
  26. data/_patches-20160112/COMPLETED-ABOVE-THIS-LINE +0 -4
  27. data/_patches-20160112/COMPLETED-BELOW-THIS-LINE +0 -4
  28. data/_patches-20160112/CR-ABOVE-THIS-LINE +0 -4
  29. data/_patches-20160112/CR-BELOW-THIS-LINE +0 -4
  30. data/_patches-20160112/WIP-ABOVE-THIS-LINE +0 -4
  31. data/_patches-20160112/WIP-BELOW-THIS-LINE +0 -4
  32. data/_patches-20160112/acceptance-test-runner +0 -29
  33. data/_patches-20160112/ansible-1 +0 -92
  34. data/_patches-20160112/cache-api-client-in-up +0 -40
  35. data/_patches-20160112/dead-code-in-actions +0 -44
  36. data/_patches-20160112/debug-changes +0 -42
  37. data/_patches-20160112/demo-rails-app +0 -1276
  38. data/_patches-20160112/eng-10166-halt-spec +0 -40
  39. data/_patches-20160112/eng-10256 +0 -527
  40. data/_patches-20160112/eng-10256-2 +0 -162
  41. data/_patches-20160112/eng-10256-ubuntu-testing +0 -88
  42. data/_patches-20160112/eng-10269-test-stuff +0 -87
  43. data/_patches-20160112/eng-10269-wtf +0 -119
  44. data/_patches-20160112/eng-10369 +0 -143
  45. data/_patches-20160112/eng-10369-tmp +0 -60
  46. data/_patches-20160112/eng-10919 +0 -56
  47. data/_patches-20160112/eng-11177-fix-actions-requires +0 -44
  48. data/_patches-20160112/eng-11442 +0 -4
  49. data/_patches-20160112/eng-11616 +0 -403
  50. data/_patches-20160112/eng-11616-2 +0 -67
  51. data/_patches-20160112/eng-11616-actual +0 -184
  52. data/_patches-20160112/eng-11625a +0 -4
  53. data/_patches-20160112/eng-11711 +0 -85
  54. data/_patches-20160112/eng-12232-command-spec +0 -236
  55. data/_patches-20160112/eng-12235 +0 -83
  56. data/_patches-20160112/eng-12235-override-refactor +0 -140
  57. data/_patches-20160112/eng-12240 +0 -103
  58. data/_patches-20160112/eng-12249 +0 -40
  59. data/_patches-20160112/eng-12301 +0 -50
  60. data/_patches-20160112/eng-12843 +0 -95
  61. data/_patches-20160112/env-source +0 -112
  62. data/_patches-20160112/frickin-vagrant-spec +0 -163
  63. data/_patches-20160112/gem-pre-version +0 -14
  64. data/_patches-20160112/gems-old +0 -9
  65. data/_patches-20160112/googles-specs +0 -713
  66. data/_patches-20160112/local-configs-ignore +0 -61
  67. data/_patches-20160112/misc +0 -79
  68. data/_patches-20160112/network-unreachable +0 -31
  69. data/_patches-20160112/new-boxfile +0 -288
  70. data/_patches-20160112/parallelization-maybe +0 -198
  71. data/_patches-20160112/read-state +0 -23
  72. data/_patches-20160112/refactor-to-use-public_address-cap +0 -25
  73. data/_patches-20160112/series +0 -60
  74. data/_patches-20160112/status +0 -12
  75. data/_patches-20160112/test-move-env-data +0 -231
  76. data/_patches-20160112/test-vagrantfile-vm1 +0 -167
  77. data/_patches-20160112/the_version_in_0.1.13.pre1 +0 -598
  78. data/_patches-20160112/vagrant-spec-mock-api +0 -137
  79. data/_patches-20160112/vagrant-vmware-plugin +0 -233
  80. data/_patches-20160112/vagrantfile +0 -403
  81. data/_patches-20160112/vagrantfile-for-acceptance-tests +0 -29
  82. data/_patches-20160112/vagrantfile-for-nick +0 -95
  83. data/_patches-20160112/vagrantfiles-to-forget-what-they-are-for +0 -134
  84. data/_patches-20160112/vm-vanished +0 -42
  85. data/_patches-20160112a/01 +0 -148
  86. data/_patches-20160112a/2 +0 -239
  87. data/_patches-20160112a/COMPLETED-ABOVE-THIS-LINE +0 -4
  88. data/_patches-20160112a/COMPLETED-BELOW-THIS-LINE +0 -4
  89. data/_patches-20160112a/CR-ABOVE-THIS-LINE +0 -4
  90. data/_patches-20160112a/CR-BELOW-THIS-LINE +0 -4
  91. data/_patches-20160112a/WIP-ABOVE-THIS-LINE +0 -4
  92. data/_patches-20160112a/WIP-BELOW-THIS-LINE +0 -4
  93. data/_patches-20160112a/acceptance-test-runner +0 -29
  94. data/_patches-20160112a/ansible-1 +0 -92
  95. data/_patches-20160112a/cache-api-client-in-up +0 -40
  96. data/_patches-20160112a/dead-code-in-actions +0 -44
  97. data/_patches-20160112a/debug-changes +0 -42
  98. data/_patches-20160112a/demo-rails-app +0 -1276
  99. data/_patches-20160112a/eng-10166-halt-spec +0 -40
  100. data/_patches-20160112a/eng-10256-ubuntu-testing +0 -88
  101. data/_patches-20160112a/eng-10269-test-stuff +0 -87
  102. data/_patches-20160112a/eng-10269-wtf +0 -119
  103. data/_patches-20160112a/eng-10369 +0 -143
  104. data/_patches-20160112a/eng-10369-tmp +0 -60
  105. data/_patches-20160112a/eng-10919 +0 -56
  106. data/_patches-20160112a/eng-11177-fix-actions-requires +0 -44
  107. data/_patches-20160112a/eng-11442 +0 -4
  108. data/_patches-20160112a/eng-11616 +0 -403
  109. data/_patches-20160112a/eng-11616-2 +0 -67
  110. data/_patches-20160112a/eng-11616-actual +0 -184
  111. data/_patches-20160112a/eng-11625a +0 -4
  112. data/_patches-20160112a/eng-11711 +0 -85
  113. data/_patches-20160112a/eng-12232-command-spec +0 -236
  114. data/_patches-20160112a/eng-12235 +0 -83
  115. data/_patches-20160112a/eng-12235-override-refactor +0 -140
  116. data/_patches-20160112a/eng-12240 +0 -103
  117. data/_patches-20160112a/eng-12249 +0 -40
  118. data/_patches-20160112a/eng-12301 +0 -50
  119. data/_patches-20160112a/eng-12843 +0 -95
  120. data/_patches-20160112a/env-source +0 -112
  121. data/_patches-20160112a/frickin-vagrant-spec +0 -163
  122. data/_patches-20160112a/gem-pre-version +0 -14
  123. data/_patches-20160112a/gems-old +0 -9
  124. data/_patches-20160112a/googles-specs +0 -713
  125. data/_patches-20160112a/local-configs-ignore +0 -61
  126. data/_patches-20160112a/misc +0 -79
  127. data/_patches-20160112a/network-unreachable +0 -31
  128. data/_patches-20160112a/new-boxfile +0 -288
  129. data/_patches-20160112a/parallelization-maybe +0 -198
  130. data/_patches-20160112a/read-state +0 -23
  131. data/_patches-20160112a/refactor-to-use-public_address-cap +0 -25
  132. data/_patches-20160112a/series +0 -58
  133. data/_patches-20160112a/status +0 -14
  134. data/_patches-20160112a/test-move-env-data +0 -231
  135. data/_patches-20160112a/test-vagrantfile-vm1 +0 -167
  136. data/_patches-20160112a/the_version_in_0.1.13.pre1 +0 -612
  137. data/_patches-20160112a/then-copy-the-newer-files +0 -632
  138. data/_patches-20160112a/vagrant-spec-mock-api +0 -137
  139. data/_patches-20160112a/vagrant-vmware-plugin +0 -233
  140. data/_patches-20160112a/vagrantfile +0 -403
  141. data/_patches-20160112a/vagrantfile-for-acceptance-tests +0 -29
  142. data/_patches-20160112a/vagrantfile-for-nick +0 -95
  143. data/_patches-20160112a/vagrantfiles-to-forget-what-they-are-for +0 -134
  144. data/_patches-20160112a/vm-vanished +0 -42
  145. data/_patches-20160113/COMPLETED-ABOVE-THIS-LINE +0 -4
  146. data/_patches-20160113/COMPLETED-BELOW-THIS-LINE +0 -4
  147. data/_patches-20160113/CR-ABOVE-THIS-LINE +0 -4
  148. data/_patches-20160113/CR-BELOW-THIS-LINE +0 -4
  149. data/_patches-20160113/WIP-ABOVE-THIS-LINE +0 -4
  150. data/_patches-20160113/WIP-BELOW-THIS-LINE +0 -4
  151. data/_patches-20160113/acceptance-test-runner +0 -29
  152. data/_patches-20160113/ansible-1 +0 -92
  153. data/_patches-20160113/cache-api-client-in-up +0 -40
  154. data/_patches-20160113/dead-code-in-actions +0 -44
  155. data/_patches-20160113/debug-changes +0 -55
  156. data/_patches-20160113/demo-rails-app +0 -1276
  157. data/_patches-20160113/eng-10166-halt-spec +0 -40
  158. data/_patches-20160113/eng-10256 +0 -543
  159. data/_patches-20160113/eng-10256-ubuntu-testing +0 -88
  160. data/_patches-20160113/eng-10269-test-stuff +0 -87
  161. data/_patches-20160113/eng-10269-wtf +0 -119
  162. data/_patches-20160113/eng-10369 +0 -143
  163. data/_patches-20160113/eng-10369-tmp +0 -60
  164. data/_patches-20160113/eng-10919 +0 -56
  165. data/_patches-20160113/eng-11177-fix-actions-requires +0 -44
  166. data/_patches-20160113/eng-11442 +0 -4
  167. data/_patches-20160113/eng-11616 +0 -403
  168. data/_patches-20160113/eng-11616-2 +0 -67
  169. data/_patches-20160113/eng-11616-actual +0 -184
  170. data/_patches-20160113/eng-11625a +0 -4
  171. data/_patches-20160113/eng-11711 +0 -85
  172. data/_patches-20160113/eng-12232-command-spec +0 -236
  173. data/_patches-20160113/eng-12235 +0 -83
  174. data/_patches-20160113/eng-12235-override-refactor +0 -140
  175. data/_patches-20160113/eng-12240 +0 -103
  176. data/_patches-20160113/eng-12249 +0 -40
  177. data/_patches-20160113/eng-12301 +0 -50
  178. data/_patches-20160113/eng-12720 +0 -47
  179. data/_patches-20160113/eng-12843 +0 -95
  180. data/_patches-20160113/env-source +0 -112
  181. data/_patches-20160113/frickin-vagrant-spec +0 -163
  182. data/_patches-20160113/gem-pre-version +0 -14
  183. data/_patches-20160113/gems-old +0 -9
  184. data/_patches-20160113/googles-specs +0 -713
  185. data/_patches-20160113/local-configs-ignore +0 -61
  186. data/_patches-20160113/misc +0 -79
  187. data/_patches-20160113/network-unreachable +0 -31
  188. data/_patches-20160113/new-boxfile +0 -288
  189. data/_patches-20160113/parallelization-maybe +0 -198
  190. data/_patches-20160113/read-state +0 -23
  191. data/_patches-20160113/refactor-to-use-public_address-cap +0 -25
  192. data/_patches-20160113/series +0 -56
  193. data/_patches-20160113/status +0 -14
  194. data/_patches-20160113/test-move-env-data +0 -231
  195. data/_patches-20160113/test-vagrantfile-vm1 +0 -167
  196. data/_patches-20160113/vagrant-spec-mock-api +0 -137
  197. data/_patches-20160113/vagrant-vmware-plugin +0 -233
  198. data/_patches-20160113/vagrantfile +0 -403
  199. data/_patches-20160113/vagrantfile-for-acceptance-tests +0 -29
  200. data/_patches-20160113/vagrantfile-for-nick +0 -95
  201. data/_patches-20160113/vagrantfiles-to-forget-what-they-are-for +0 -134
  202. data/_patches-20160113/vm-vanished +0 -42
  203. data/_patches-20160118/COMPLETED-ABOVE-THIS-LINE +0 -4
  204. data/_patches-20160118/COMPLETED-BELOW-THIS-LINE +0 -4
  205. data/_patches-20160118/CR-ABOVE-THIS-LINE +0 -4
  206. data/_patches-20160118/CR-BELOW-THIS-LINE +0 -4
  207. data/_patches-20160118/WIP-ABOVE-THIS-LINE +0 -4
  208. data/_patches-20160118/WIP-BELOW-THIS-LINE +0 -4
  209. data/_patches-20160118/acceptance-test-runner +0 -29
  210. data/_patches-20160118/ansible-1 +0 -92
  211. data/_patches-20160118/cache-api-client-in-up +0 -40
  212. data/_patches-20160118/dead-code-in-actions +0 -44
  213. data/_patches-20160118/debug-changes +0 -55
  214. data/_patches-20160118/demo-rails-app +0 -1276
  215. data/_patches-20160118/eng-10166-halt-spec +0 -40
  216. data/_patches-20160118/eng-10256 +0 -554
  217. data/_patches-20160118/eng-10256-cr +0 -314
  218. data/_patches-20160118/eng-10256-ubuntu-testing +0 -88
  219. data/_patches-20160118/eng-10269-test-stuff +0 -87
  220. data/_patches-20160118/eng-10269-wtf +0 -119
  221. data/_patches-20160118/eng-10369 +0 -143
  222. data/_patches-20160118/eng-10369-tmp +0 -60
  223. data/_patches-20160118/eng-10919 +0 -56
  224. data/_patches-20160118/eng-11177-fix-actions-requires +0 -44
  225. data/_patches-20160118/eng-11442 +0 -4
  226. data/_patches-20160118/eng-11616 +0 -403
  227. data/_patches-20160118/eng-11616-2 +0 -67
  228. data/_patches-20160118/eng-11616-actual +0 -184
  229. data/_patches-20160118/eng-11625a +0 -4
  230. data/_patches-20160118/eng-11711 +0 -85
  231. data/_patches-20160118/eng-12232-command-spec +0 -236
  232. data/_patches-20160118/eng-12235 +0 -83
  233. data/_patches-20160118/eng-12235-override-refactor +0 -140
  234. data/_patches-20160118/eng-12240 +0 -103
  235. data/_patches-20160118/eng-12249 +0 -40
  236. data/_patches-20160118/eng-12301 +0 -50
  237. data/_patches-20160118/eng-12720 +0 -74
  238. data/_patches-20160118/eng-12843 +0 -95
  239. data/_patches-20160118/eng-13040 +0 -291
  240. data/_patches-20160118/env-source +0 -112
  241. data/_patches-20160118/frickin-vagrant-spec +0 -163
  242. data/_patches-20160118/gem-pre-version +0 -14
  243. data/_patches-20160118/gems-old +0 -9
  244. data/_patches-20160118/googles-specs +0 -713
  245. data/_patches-20160118/local-configs-ignore +0 -61
  246. data/_patches-20160118/misc +0 -79
  247. data/_patches-20160118/network-unreachable +0 -31
  248. data/_patches-20160118/new-boxfile +0 -288
  249. data/_patches-20160118/parallelization-maybe +0 -198
  250. data/_patches-20160118/port-forwarding-processes +0 -87
  251. data/_patches-20160118/read-state +0 -23
  252. data/_patches-20160118/refactor-to-use-public_address-cap +0 -25
  253. data/_patches-20160118/series +0 -59
  254. data/_patches-20160118/status +0 -13
  255. data/_patches-20160118/test-move-env-data +0 -231
  256. data/_patches-20160118/test-vagrantfile-vm1 +0 -167
  257. data/_patches-20160118/vagrant-spec-mock-api +0 -137
  258. data/_patches-20160118/vagrant-vmware-plugin +0 -233
  259. data/_patches-20160118/vagrantfile +0 -403
  260. data/_patches-20160118/vagrantfile-for-acceptance-tests +0 -29
  261. data/_patches-20160118/vagrantfile-for-nick +0 -95
  262. data/_patches-20160118/vagrantfiles-to-forget-what-they-are-for +0 -134
  263. data/_patches-20160118/vm-vanished +0 -42
  264. data/_patches-20160118a/COMPLETED-ABOVE-THIS-LINE +0 -4
  265. data/_patches-20160118a/COMPLETED-BELOW-THIS-LINE +0 -4
  266. data/_patches-20160118a/CR-ABOVE-THIS-LINE +0 -4
  267. data/_patches-20160118a/CR-BELOW-THIS-LINE +0 -4
  268. data/_patches-20160118a/WIP-ABOVE-THIS-LINE +0 -4
  269. data/_patches-20160118a/WIP-BELOW-THIS-LINE +0 -4
  270. data/_patches-20160118a/acceptance-test-runner +0 -29
  271. data/_patches-20160118a/ansible-1 +0 -92
  272. data/_patches-20160118a/bar +0 -189
  273. data/_patches-20160118a/cache-api-client-in-up +0 -40
  274. data/_patches-20160118a/dead-code-in-actions +0 -44
  275. data/_patches-20160118a/debug-changes +0 -55
  276. data/_patches-20160118a/demo-rails-app +0 -1276
  277. data/_patches-20160118a/eng-10166-halt-spec +0 -40
  278. data/_patches-20160118a/eng-10256 +0 -554
  279. data/_patches-20160118a/eng-10256-cr +0 -314
  280. data/_patches-20160118a/eng-10256-ubuntu-testing +0 -88
  281. data/_patches-20160118a/eng-10269-test-stuff +0 -87
  282. data/_patches-20160118a/eng-10269-wtf +0 -119
  283. data/_patches-20160118a/eng-10369 +0 -143
  284. data/_patches-20160118a/eng-10369-tmp +0 -60
  285. data/_patches-20160118a/eng-10919 +0 -56
  286. data/_patches-20160118a/eng-11177-fix-actions-requires +0 -44
  287. data/_patches-20160118a/eng-11442 +0 -4
  288. data/_patches-20160118a/eng-11616 +0 -403
  289. data/_patches-20160118a/eng-11616-2 +0 -67
  290. data/_patches-20160118a/eng-11616-actual +0 -184
  291. data/_patches-20160118a/eng-11625a +0 -4
  292. data/_patches-20160118a/eng-11711 +0 -85
  293. data/_patches-20160118a/eng-12232-command-spec +0 -236
  294. data/_patches-20160118a/eng-12235 +0 -83
  295. data/_patches-20160118a/eng-12235-override-refactor +0 -140
  296. data/_patches-20160118a/eng-12240 +0 -103
  297. data/_patches-20160118a/eng-12249 +0 -40
  298. data/_patches-20160118a/eng-12301 +0 -50
  299. data/_patches-20160118a/eng-12720 +0 -74
  300. data/_patches-20160118a/eng-12843 +0 -95
  301. data/_patches-20160118a/eng-13040 +0 -291
  302. data/_patches-20160118a/env-source +0 -112
  303. data/_patches-20160118a/foo +0 -169
  304. data/_patches-20160118a/frickin-vagrant-spec +0 -163
  305. data/_patches-20160118a/gem-pre-version +0 -14
  306. data/_patches-20160118a/gems-old +0 -9
  307. data/_patches-20160118a/googles-specs +0 -713
  308. data/_patches-20160118a/guestport-madness +0 -59
  309. data/_patches-20160118a/local-configs-ignore +0 -61
  310. data/_patches-20160118a/misc +0 -79
  311. data/_patches-20160118a/network-unreachable +0 -31
  312. data/_patches-20160118a/new-boxfile +0 -288
  313. data/_patches-20160118a/parallelization-maybe +0 -198
  314. data/_patches-20160118a/port-forwarding-processes +0 -87
  315. data/_patches-20160118a/read-state +0 -23
  316. data/_patches-20160118a/refactor-to-use-public_address-cap +0 -25
  317. data/_patches-20160118a/series +0 -62
  318. data/_patches-20160118a/status +0 -14
  319. data/_patches-20160118a/test-move-env-data +0 -231
  320. data/_patches-20160118a/test-vagrantfile-vm1 +0 -167
  321. data/_patches-20160118a/vagrant-spec-mock-api +0 -137
  322. data/_patches-20160118a/vagrant-vmware-plugin +0 -233
  323. data/_patches-20160118a/vagrantfile +0 -403
  324. data/_patches-20160118a/vagrantfile-for-acceptance-tests +0 -29
  325. data/_patches-20160118a/vagrantfile-for-nick +0 -95
  326. data/_patches-20160118a/vagrantfiles-to-forget-what-they-are-for +0 -134
  327. data/_patches-20160118a/vm-vanished +0 -42
@@ -1,184 +0,0 @@
1
- # HG changeset patch
2
- # Parent bc32846888f966e4da20f51175d02f6aea678dd4
3
- ENG-11616 actually refactoring up
4
-
5
- diff -r bc32846888f9 lib/vagrant-skytap/action.rb
6
- --- a/lib/vagrant-skytap/action.rb Mon Nov 16 15:47:02 2015 -0800
7
- +++ b/lib/vagrant-skytap/action.rb Mon Nov 16 18:02:32 2015 -0800
8
- @@ -192,33 +192,56 @@
9
- end
10
- end
11
-
12
- - # This action is called to bring the box up from nothing.
13
- + # This action is called to actually bring the box up.
14
- def self.action_up
15
- Vagrant::Action::Builder.new.tap do |b|
16
- - b.use HandleBox
17
- - b.use action_initialize
18
- - b.use action_create_vm
19
- -
20
- + b.use action_pre_up
21
- b.use Call, IsRunning do |env, b1|
22
- if env[:result]
23
- b1.use MessageAlreadyRunning
24
- next
25
- end
26
- + b1.use action_actual_up
27
- + b1.use action_post_up
28
- + end
29
- + end
30
- + end
31
-
32
- - b1.use Call, IsStopped do |env2, b2|
33
- - if env2[:result]
34
- - b2.use UpdateHardware
35
- - b2.use SetHostname
36
- - b2.use action_prepare_boot
37
- - end
38
- -
39
- - b2.use RunVm
40
- - b2.use WaitForCommunicator
41
- + # This action is called to prepare to bring the box up from nothing.
42
- + def self.action_pre_up
43
- + Vagrant::Action::Builder.new.tap do |b|
44
- + b.use HandleBox
45
- + b.use action_initialize
46
- + b.use action_create_vm
47
- + b.use Call, IsStopped do |env2, b2|
48
- + if env2[:result]
49
- + b2.use UpdateHardware
50
- + b2.use SetHostname
51
- + b2.use action_prepare_boot
52
- end
53
- end
54
- end
55
- end
56
-
57
- + # This action is called to actually bring the box up.
58
- + def self.action_actual_up
59
- + Vagrant::Action::Builder.new.tap do |b|
60
- + b.use Call, IsRunning do |env, b1|
61
- + if env[:result]
62
- + b1.use MessageAlreadyRunning
63
- + next
64
- + end
65
- + b2.use RunVm
66
- + end
67
- + end
68
- + end
69
- +
70
- + def self.action_post_up
71
- + Vagrant::Action::Builder.new.tap do |b|
72
- + b.use WaitForCommunicator
73
- + end
74
- + end
75
- +
76
- def self.action_reload
77
- Vagrant::Action::Builder.new.tap do |b|
78
- b.use action_initialize
79
- diff -r bc32846888f9 lib/vagrant-skytap/action/run_environment.rb
80
- --- a/lib/vagrant-skytap/action/run_environment.rb Mon Nov 16 15:47:02 2015 -0800
81
- +++ b/lib/vagrant-skytap/action/run_environment.rb Mon Nov 16 18:02:32 2015 -0800
82
- @@ -17,7 +17,7 @@
83
-
84
- def call(env)
85
- env[:ui].info(I18n.t("vagrant_skytap.launching_instance"))
86
- - environment.run!
87
- + environment.run_multiple!
88
-
89
- @app.call(env)
90
- end
91
- diff -r bc32846888f9 lib/vagrant-skytap/api/environment.rb
92
- --- a/lib/vagrant-skytap/api/environment.rb Mon Nov 16 15:47:02 2015 -0800
93
- +++ b/lib/vagrant-skytap/api/environment.rb Mon Nov 16 18:02:32 2015 -0800
94
- @@ -48,6 +48,10 @@
95
- @provider_config = env[:machine].provider_config
96
- end
97
-
98
- + def run_multiple!(vm_ids = [])
99
- + run!
100
- + end
101
- +
102
- def vms
103
- @vms ||= (get_api_attribute('vms') || []).collect do |vm_attrs|
104
- Vm.new(vm_attrs, self, env)
105
- diff -r bc32846888f9 lib/vagrant-skytap/command/up.rb
106
- --- a/lib/vagrant-skytap/command/up.rb Mon Nov 16 15:47:02 2015 -0800
107
- +++ b/lib/vagrant-skytap/command/up.rb Mon Nov 16 18:02:32 2015 -0800
108
- @@ -1,5 +1,6 @@
109
- require 'optparse'
110
- require_relative 'start_mixins'
111
- +require 'byebug'
112
-
113
- module VagrantPlugins
114
- module Skytap
115
- @@ -53,22 +54,24 @@
116
-
117
- # Build up the batch job of what we'll do
118
- machines = []
119
- - @env.batch(options[:parallel]) do |batch|
120
- - names = argv
121
- - if names.empty?
122
- - autostart = false
123
- - @env.vagrantfile.machine_names_and_options.each do |n, o|
124
- - autostart = true if o.key?(:autostart)
125
- - o[:autostart] = true if !o.key?(:autostart)
126
- - names << n.to_s if o[:autostart]
127
- - end
128
- -
129
- - # If we have an autostart key but no names, it means that
130
- - # all machines are autostart: false and we don't start anything.
131
- - names = nil if autostart && names.empty?
132
- + names = argv
133
- + if names.empty?
134
- + autostart = false
135
- + @env.vagrantfile.machine_names_and_options.each do |n, o|
136
- + autostart = true if o.key?(:autostart)
137
- + o[:autostart] = true if !o.key?(:autostart)
138
- + names << n.to_s if o[:autostart]
139
- end
140
-
141
- - if names
142
- + # If we have an autostart key but no names, it means that
143
- + # all machines are autostart: false and we don't start anything.
144
- + names = nil if autostart && names.empty?
145
- + end
146
- +
147
- +
148
- +
149
- + if names
150
- + @env.batch(options[:parallel]) do |batch|
151
- with_target_vms(names, provider: options[:provider]) do |machine|
152
- @env.ui.info(I18n.t(
153
- "vagrant.commands.up.upping",
154
- @@ -77,11 +80,29 @@
155
-
156
- machines << machine
157
-
158
- - batch.action(machine, :up, options)
159
- + batch.action(machine, :pre_up, options)
160
- + if !options[:parallel]
161
- + batch.action(machine, :up, options)
162
- + #batch.action(machine, :post_up, options) # note: this gives success message even if the machine was already running
163
- + end
164
- end
165
- end
166
- end
167
-
168
- + # Don't use normal Vagrant parallelization to run VMs
169
- + if options[:parallel] && machines
170
- + # do thing, then
171
- +
172
- + # WaitForCommunicator
173
- + @env.batch do |batch|
174
- + with_target_vms(names, provider: options[:provider]) do |machine|
175
- + batch.action(machine, :post_up, options)
176
- + end
177
- + end
178
- + end
179
- +
180
- +
181
- +
182
- if machines.empty?
183
- @env.ui.info(I18n.t("vagrant.up_no_machines"))
184
- return 0
@@ -1,4 +0,0 @@
1
- # HG changeset patch
2
- # Parent 0f7b255ffa6a13cd9435bebbfe2bee9f618f46a6
3
- ENG-11625 find clean way to just invoke the builtin action directly
4
-
@@ -1,85 +0,0 @@
1
- # HG changeset patch
2
- # Parent 1ead463a91644fcbe466a90a609e9ca004c03ccb
3
- ENG-11711 Clean up redundant REST calls -- this currently does not work -- the env hash probably gets cleared for each vm
4
-
5
- diff -r 1ead463a9164 lib/vagrant-skytap/action.rb
6
- --- a/lib/vagrant-skytap/action.rb Fri Nov 06 19:26:22 2015 -0800
7
- +++ b/lib/vagrant-skytap/action.rb Fri Nov 06 19:39:47 2015 -0800
8
- @@ -115,10 +115,14 @@
9
- # key.
10
- def self.action_read_ssh_info
11
- Vagrant::Action::Builder.new.tap do |b|
12
- - b.use ConfigValidate
13
- - b.use InitializeAPIClient
14
- - b.use FetchEnvironment
15
- - b.use ReadSSHInfo
16
- + b.use Call, HasSSHInfo do |env1, b1|
17
- + unless env1[:result]
18
- + b1.use ConfigValidate
19
- + b1.use InitializeAPIClient
20
- + b1.use FetchEnvironment
21
- + b1.use ReadSSHInfo
22
- + end
23
- + end
24
- end
25
- end
26
-
27
- @@ -251,6 +255,7 @@
28
- autoload :ExistenceCheck, action_root.join("existence_check")
29
- autoload :FetchEnvironment, action_root.join("fetch_environment")
30
- autoload :InitializeAPIClient, action_root.join("initialize_api_client")
31
- + autoload :HasSSHInfo, action_root.join("has_ssh_info")
32
- autoload :IsRunning, action_root.join("is_running")
33
- autoload :IsStopped, action_root.join("is_stopped")
34
- autoload :IsSuspended, action_root.join("is_suspended")
35
- diff -r 1ead463a9164 lib/vagrant-skytap/action/has_ssh_info.rb
36
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
37
- +++ b/lib/vagrant-skytap/action/has_ssh_info.rb Fri Nov 06 19:39:47 2015 -0800
38
- @@ -0,0 +1,19 @@
39
- +module VagrantPlugins
40
- + module Skytap
41
- + module Action
42
- + # This can be used with "Call" built-in to check if the ssh info
43
- + # has been read.
44
- + class HasSSHInfo
45
- + def initialize(app, env)
46
- + @app = app
47
- + @logger = Log4r::Logger.new("vagrant_skytap::action::has_ssh_info")
48
- + end
49
- +
50
- + def call(env)
51
- + env[:result] = env[:machine_ssh_info].present?
52
- + @app.call(env)
53
- + end
54
- + end
55
- + end
56
- + end
57
- +end
58
- diff -r 1ead463a9164 lib/vagrant-skytap/action/initialize_api_client.rb
59
- --- a/lib/vagrant-skytap/action/initialize_api_client.rb Fri Nov 06 19:26:22 2015 -0800
60
- +++ b/lib/vagrant-skytap/action/initialize_api_client.rb Fri Nov 06 19:39:47 2015 -0800
61
- @@ -7,17 +7,20 @@
62
- # This action initializes the API client, verifies the provided
63
- # credentials, and stores the API client object in env[:api_client].
64
- class InitializeAPIClient
65
- - def initialize(app, env)
66
- + def initialize(app, env, reinitialize=false)
67
- @app = app
68
- @logger = Log4r::Logger.new("vagrant_skytap::action::initialize_api_client")
69
- + @reinitialize = reinitialize
70
- end
71
-
72
- def call(env)
73
- @logger.info("Connecting to Skytap...")
74
-
75
- - client = API::Client.new(env[:machine].provider_config)
76
- - if client.get('/configurations').code == '200'
77
- - env[:api_client] = client
78
- + unless env[:api_client] && !@reinitialize
79
- + client = API::Client.new(env[:machine].provider_config)
80
- + if client.get('/configurations').code == '200'
81
- + env[:api_client] = client
82
- + end
83
- end
84
-
85
- @app.call(env)
@@ -1,236 +0,0 @@
1
- # HG changeset patch
2
- # Parent 54e776bb035d336526426643b3a371f7d04b7b0d
3
- ENG-12232 command publish-set show spec
4
-
5
- diff -r 54e776bb035d spec/unit/base.rb
6
- --- a/spec/unit/base.rb Tue Dec 15 15:11:38 2015 -0800
7
- +++ b/spec/unit/base.rb Tue Dec 15 15:30:51 2015 -0800
8
- @@ -46,7 +46,7 @@
9
- ENV["VAGRANT_CWD"] = Dir.mktmpdir("vagrant")
10
-
11
- # Set the dummy provider to the default for tests
12
- -ENV["VAGRANT_DEFAULT_PROVIDER"] = "dummy"
13
- +ENV["VAGRANT_DEFAULT_PROVIDER"] = "skytap"
14
-
15
- # Unset all host plugins so that we aren't executing subprocess things
16
- # to detect a host for every test.
17
- diff -r 54e776bb035d spec/unit/commands/publish_url/command/create_spec.rb
18
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
19
- +++ b/spec/unit/commands/publish_url/command/create_spec.rb Tue Dec 15 15:30:51 2015 -0800
20
- @@ -0,0 +1,113 @@
21
- +BASE_PATH = File.expand_path('../../../..', __FILE__)
22
- +
23
- +require File.expand_path("#{BASE_PATH}/base")
24
- +require 'vagrant-skytap/api/publish_set'
25
- +require 'vagrant-skytap/api/environment'
26
- +require 'vagrant-skytap/command/publish_url/create'
27
- +require 'vagrant-skytap/command/helpers'
28
- +require 'vagrant-skytap/provider'
29
- +require 'ap'
30
- +
31
- +describe VagrantPlugins::Skytap::CommandPublishUrl::Create do
32
- + include_context "unit"
33
- + include_context "command plugin helpers"
34
- +
35
- + let(:empty_environment_attrs) { JSON.load(File.read(File.join(BASE_PATH, 'skeletons', 'empty_environment.json')))}
36
- + let(:vm1_attrs) { JSON.load(File.read(File.join(BASE_PATH, 'skeletons', 'vm1.json'))) }
37
- + let(:vm2_attrs) { vm1_attrs.merge("id" => "6981851", "name" => "VM2") }
38
- + let(:empty_publish_set_attrs) { JSON.load(File.read(File.join(BASE_PATH, 'skeletons', 'empty_publish_set.json')))}
39
- +
40
- + let(:publish_set_attrs) do
41
- + empty_publish_set_attrs.dup.tap do |ret|
42
- + ret['vms'] = [
43
- + {"vm_ref" => "http://example.com/vms/#{vm1_attrs['id']}"},
44
- + {"vm_ref" => "http://example.com/vms/#{vm2_attrs['id']}"}
45
- + ]
46
- + end
47
- + end
48
- +
49
- + let(:attrs) do
50
- + empty_environment_attrs.dup.tap do |ret|
51
- + ret['vms'] = [vm1_attrs, vm2_attrs]
52
- + ret['publish_sets'] = publish_set_attrs
53
- + end
54
- + end
55
- +
56
- + let(:argv) { [] }
57
- + let(:iso_env) do
58
- + # We have to create a Vagrantfile so there is a root path
59
- + env = isolated_environment
60
- + #debugger
61
- + #env.vagrantfile("")
62
- +
63
- + env.vagrantfile(<<-VF)
64
- + Vagrant.configure("2") do |config|
65
- + config.vm.box = "skytap/empty"
66
- +
67
- + config.vm.provider :skytap do |skytap, override|
68
- + skytap.base_url = "https://example.com/"
69
- + skytap.username = "foo"
70
- + skytap.api_token = "bar"
71
- + end
72
- +
73
- + config.vm.define "vm1" do |ubuntu|
74
- + ubuntu.vm.provider :skytap do |box|
75
- + box.vm_url = "vms/999"
76
- + end
77
- + end
78
- +
79
- + config.vm.define "vm2" do |ubuntu|
80
- + ubuntu.vm.provider :skytap do |box|
81
- + box.vm_url = "vms/999"
82
- + end
83
- + end
84
- + end
85
- + VF
86
- + env.create_vagrant_env
87
- + end
88
- +
89
- + subject { described_class.new(argv, iso_env) }
90
- +
91
- + before do
92
- + # don't really need, since we're reading an environment
93
- + VagrantPlugins::Skytap::Provider.any_instance.stub(:state).and_return(Vagrant::MachineState.new(:running, "", ""))
94
- +
95
- + stub_request(:get, %r{/configurations$}).to_return(status: 200, body: "")
96
- + stub_request(:get, %r{/configurations/\d+}).to_return(status: 200, body: JSON.dump(attrs))
97
- + stub_request(:post, %r{/configurations/\d+/publish_sets}).to_return(status: 200, body: JSON.dump(publish_set_attrs))
98
- +
99
- + allow(VagrantPlugins::Skytap::API::Environment).to receive(:properties).and_return({'url' => '/configurations/5570024'})
100
- +
101
- + WebMock.after_request do |request_signature, response|
102
- + puts "Request #{request_signature} was made and #{response} was returned"
103
- + end
104
- + end
105
- +
106
- +
107
- +
108
- + context "with --no-password" do
109
- + let(:argv) { ["--no-password", "vm1", "vm2"] }
110
- +
111
- + it "posts" do
112
- + #debugger
113
- + #expect { subject.execute }.to output("foo").to_stdout_from_any_process
114
- + nil
115
- + subject.execute
116
- + expect(a_request(:post, "https://foo:bar@example.com/configurations/5570024/publish_sets").
117
- + with do |req|
118
- + debugger
119
- + req.body == JSON.dump(
120
- + name: "Vagrant publish set",
121
- + publish_set_type: "single_url",
122
- + vms: [
123
- + {vm_ref: '/vms/6981850', access: "run_and_use"},
124
- + {vm_ref: '/vms/6981851', access: "run_and_use"},
125
- + ],
126
- + password: ""
127
- + )
128
- + end).
129
- + to have_been_made.once
130
- +
131
- + end
132
- + end
133
- +end
134
- diff -r 54e776bb035d spec/unit/commands/publish_url/command/show_spec.rb
135
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
136
- +++ b/spec/unit/commands/publish_url/command/show_spec.rb Tue Dec 15 15:30:51 2015 -0800
137
- @@ -0,0 +1,88 @@
138
- +BASE_PATH = File.expand_path('../../../..', __FILE__)
139
- +
140
- +require File.expand_path("#{BASE_PATH}/base")
141
- +require 'vagrant-skytap/api/publish_set'
142
- +require 'vagrant-skytap/api/environment'
143
- +require 'vagrant-skytap/command/publish_url/show'
144
- +require 'vagrant-skytap/command/helpers'
145
- +require 'vagrant-skytap/provider'
146
- +require 'ap'
147
- +
148
- +describe VagrantPlugins::Skytap::CommandPublishUrl::Show do
149
- + include_context "unit"
150
- + include_context "command plugin helpers"
151
- +
152
- + let(:empty_environment_attrs) { JSON.load(File.read(File.join(BASE_PATH, 'skeletons', 'empty_environment.json')))}
153
- + let(:vm1_attrs) { JSON.load(File.read(File.join(BASE_PATH, 'skeletons', 'vm1.json'))) }
154
- + let(:empty_publish_set_attrs) { JSON.load(File.read(File.join(BASE_PATH, 'skeletons', 'empty_publish_set.json')))}
155
- +
156
- + let(:attrs) do
157
- + vm2_attrs = vm1_attrs.merge("id" => "6981851", "name" => "VM2")
158
- + empty_environment_attrs.dup.tap do |ret|
159
- + ret['vms'] = [vm1_attrs, vm2_attrs]
160
- + ret['publish_sets'] = [empty_publish_set_attrs.dup]
161
- + ret['publish_sets'].first['vms'] = [
162
- + {"vm_ref" => "http://example.com/vms/#{vm1_attrs['id']}"},
163
- + {"vm_ref" => "http://example.com/vms/#{vm2_attrs['id']}"}
164
- + ]
165
- + end
166
- + end
167
- +
168
- + let(:argv) { [] }
169
- + let(:iso_env) do
170
- + # We have to create a Vagrantfile so there is a root path
171
- + env = isolated_environment
172
- + #debugger
173
- + #env.vagrantfile("")
174
- +
175
- + env.vagrantfile(<<-VF)
176
- + Vagrant.configure("2") do |config|
177
- + config.vm.box = "skytap/empty"
178
- +
179
- + config.vm.provider :skytap do |skytap, override|
180
- + skytap.base_url = "https://test.skytap.com/"
181
- + skytap.username = "etrue"
182
- + skytap.api_token = "d41e7b2f98b63844512c0d62d0e5496949d35f57"
183
- + skytap.vpn_url = "https://test.skytap.com/vpns/vpn-286952"
184
- + end
185
- +
186
- + config.vm.define "vm1" do |ubuntu|
187
- + ubuntu.vm.provider :skytap do |box|
188
- + box.vm_url = "https://test.skytap.com/vms/6984688"
189
- + end
190
- + ubuntu.ssh.username = "autoadmin"
191
- + ubuntu.ssh.password = "autoadmin"
192
- + end
193
- + end
194
- + VF
195
- + env.create_vagrant_env
196
- + end
197
- +
198
- + subject { described_class.new(argv, iso_env) }
199
- +
200
- + before do
201
- + # don't really need, since we're reading an environment
202
- + VagrantPlugins::Skytap::Provider.any_instance.stub(:state).and_return(Vagrant::MachineState.new(:running, "", ""))
203
- +
204
- + stub_request(:get, %r{/configurations$}).to_return(status: 200, body: "")
205
- + stub_request(:get, %r{/configurations/\d+}).to_return(status: 200, body: JSON.dump(attrs))
206
- + allow(VagrantPlugins::Skytap::API::Environment).to receive(:properties).and_return({'url' => '/configurations/1'})
207
- +
208
- + WebMock.after_request do |request_signature, response|
209
- + puts "Request #{request_signature} was made and #{response} was returned"
210
- + end
211
- + end
212
- +
213
- +
214
- +
215
- + context "with no arguments" do
216
- + #let(:argv) { [] }
217
- +
218
- + it "shows the output" do
219
- + #debugger
220
- + #expect { subject.execute }.to output("foo").to_stdout_from_any_process
221
- + nil
222
- +
223
- + end
224
- + end
225
- +end
226
- diff -r 54e776bb035d spec/unit/skeletons/empty_environment.json
227
- --- a/spec/unit/skeletons/empty_environment.json Tue Dec 15 15:11:38 2015 -0800
228
- +++ b/spec/unit/skeletons/empty_environment.json Tue Dec 15 15:30:51 2015 -0800
229
- @@ -1,6 +1,6 @@
230
- {
231
- "id": "5570024",
232
- - "url": "https://example.com/templates/5570024",
233
- + "url": "https://example.com/configurations/5570024",
234
- "name": "Environment 1",
235
- "error": "",
236
- "runstate": "running",
@@ -1,83 +0,0 @@
1
- # HG changeset patch
2
- # Parent ffe81b8c1fbc30808778011dfb11428c24e94647
3
- # Parent 7bf28b483ba4495c173d9316aee2d8482d9705ab
4
- ENG-12235 override default "vagrant share" command for Skytap provider.
5
-
6
- diff -r ffe81b8c1fbc lib/vagrant-skytap/command/share.rb
7
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8
- +++ b/lib/vagrant-skytap/command/share.rb Tue Dec 15 13:01:38 2015 -0800
9
- @@ -0,0 +1,59 @@
10
- +# Different behavior than the standard -- this creates a publish set
11
- +# and outputs the URL.
12
- +require_relative 'overridden_command'
13
- +
14
- +module VagrantPlugins
15
- + module Skytap
16
- + module Command
17
- + class Share < OverriddenCommand
18
- + def default_command_plugin
19
- + VagrantPlugins::Share::Plugin
20
- + end
21
- +
22
- + def skytap_implementation
23
- +
24
- + # read args to see if we've got the --fallback flag
25
- + # is this destructive?
26
- + debugger
27
- +# options = {}
28
- +# options[:destroy_on_error] = true
29
- +# options[:parallel] = true
30
- +# options[:provision_ignore_sentinel] = false
31
- +#
32
- +# opts = OptionParser.new do |o|
33
- +# o.banner = "Usage: vagrant up [options] [name]"
34
- +# o.separator ""
35
- +# o.separator "Options:"
36
- +# o.separator ""
37
- +#
38
- +# build_start_options(o, options)
39
- +#
40
- +# o.on("--[no-]destroy-on-error",
41
- +# "Destroy machine if any fatal error happens (default to true)") do |destroy|
42
- +# options[:destroy_on_error] = destroy
43
- +# end
44
- +#
45
- +# o.on("--[no-]parallel",
46
- +# "Enable or disable parallelism if provider supports it") do |parallel|
47
- +# options[:parallel] = parallel
48
- +# end
49
- +#
50
- +# o.on("--provider PROVIDER", String,
51
- +# "Back the machine with a specific provider") do |provider|
52
- +# options[:provider] = provider
53
- +# end
54
- +# end
55
- +#
56
- +# # Parse the options
57
- +# argv = parse_options(opts)
58
- +# return if !argv
59
- +
60
- +
61
- +
62
- + command_class(VagrantPlugins::Skytap::Plugin, "publish-url").new(@argv, @env).execute
63
- + end
64
- + end
65
- + end
66
- + end
67
- +end
68
- +
69
- diff -r ffe81b8c1fbc lib/vagrant-skytap/plugin.rb
70
- --- a/lib/vagrant-skytap/plugin.rb Tue Dec 15 13:01:26 2015 -0800
71
- +++ b/lib/vagrant-skytap/plugin.rb Tue Dec 15 13:01:38 2015 -0800
72
- @@ -44,6 +44,11 @@
73
- Command::PublishUrlRoot
74
- end
75
-
76
- + command("share", primary: true) do
77
- + require_relative "command/share"
78
- + Command::Share
79
- + end
80
- +
81
- provider_capability(:skytap, :public_address) do
82
- require_relative "cap/public_address"
83
- Cap::PublicAddress