brightbox-cli 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. data/README +13 -17
  2. data/README.rdoc +13 -17
  3. data/brightbox-cli.gemspec +1 -1
  4. data/lib/brightbox-cli/accounts.rb +7 -0
  5. data/lib/brightbox-cli/api.rb +3 -0
  6. data/lib/brightbox-cli/commands/config-client-list.rb +1 -1
  7. data/lib/brightbox-cli/commands/firewall-rules-create.rb +4 -0
  8. data/lib/brightbox-cli/commands/firewall-rules-update.rb +49 -0
  9. data/lib/brightbox-cli/commands/groups-show.rb +1 -1
  10. data/lib/brightbox-cli/commands/groups-update.rb +3 -1
  11. data/lib/brightbox-cli/commands/images-destroy.rb +1 -1
  12. data/lib/brightbox-cli/commands/images-list.rb +9 -3
  13. data/lib/brightbox-cli/commands/images-register.rb +1 -1
  14. data/lib/brightbox-cli/commands/images-update.rb +3 -1
  15. data/lib/brightbox-cli/commands/lbs-update.rb +4 -2
  16. data/lib/brightbox-cli/commands/{servers-activate-cloud.rb → servers-activate-console.rb} +2 -1
  17. data/lib/brightbox-cli/commands/servers-update.rb +2 -1
  18. data/lib/brightbox-cli/config.rb +17 -2
  19. data/lib/brightbox-cli/detailed_server.rb +1 -1
  20. data/lib/brightbox-cli/firewall_rule.rb +6 -0
  21. data/lib/brightbox-cli/gli_global_hooks.rb +8 -1
  22. data/lib/brightbox-cli/images.rb +22 -1
  23. data/lib/brightbox-cli/nilable_hash.rb +7 -0
  24. data/lib/brightbox-cli/server_groups.rb +0 -6
  25. data/lib/brightbox-cli/servers.rb +6 -2
  26. data/lib/brightbox-cli/tables.rb +13 -0
  27. data/lib/brightbox-cli/vendor/fog/README.rdoc +2 -9
  28. data/lib/brightbox-cli/vendor/fog/Rakefile +3 -2
  29. data/lib/brightbox-cli/vendor/fog/changelog.txt +213 -0
  30. data/lib/brightbox-cli/vendor/fog/docs/_layouts/default.html +1 -1
  31. data/lib/brightbox-cli/vendor/fog/docs/about/contributing.markdown +1 -1
  32. data/lib/brightbox-cli/vendor/fog/docs/about/getting_started.markdown +28 -3
  33. data/lib/brightbox-cli/vendor/fog/docs/dns/index.markdown +1 -1
  34. data/lib/brightbox-cli/vendor/fog/docs/index.markdown +2 -10
  35. data/lib/brightbox-cli/vendor/fog/docs/storage/index.markdown +2 -2
  36. data/lib/brightbox-cli/vendor/fog/fog.gemspec +6 -5
  37. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/auto_scaling.rb +3 -1
  38. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/cloud_formation.rb +3 -0
  39. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/cloud_watch.rb +3 -1
  40. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/compute.rb +5 -3
  41. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/elb.rb +4 -2
  42. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/emr.rb +133 -0
  43. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/addresses.rb +1 -1
  44. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/key_pairs.rb +1 -1
  45. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/security_groups.rb +1 -1
  46. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/server.rb +4 -2
  47. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/servers.rb +1 -1
  48. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/snapshots.rb +1 -1
  49. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/spot_request.rb +21 -4
  50. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/spot_requests.rb +45 -1
  51. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/compute/volumes.rb +1 -1
  52. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/elb/load_balancer.rb +2 -0
  53. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/models/storage/file.rb +1 -1
  54. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cdn/get_invalidation_list.rb +0 -1
  55. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/cloud_formation/update_stack.rb +19 -0
  56. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/add_instance_groups.rb +28 -0
  57. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/add_job_flow_steps.rb +17 -0
  58. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/describe_job_flows.rb +140 -0
  59. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/modify_instance_groups.rb +17 -0
  60. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/run_job_flow.rb +19 -0
  61. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/set_termination_protection.rb +17 -0
  62. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/parsers/emr/terminate_job_flows.rb +17 -0
  63. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/rds.rb +3 -1
  64. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_formation/create_stack.rb +6 -0
  65. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/cloud_formation/update_stack.rb +62 -0
  66. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +141 -36
  67. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/delete_security_group.rb +25 -0
  68. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/delete_tags.rb +1 -1
  69. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_addresses.rb +2 -2
  70. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_availability_zones.rb +5 -2
  71. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_images.rb +1 -1
  72. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_instances.rb +15 -6
  73. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_key_pairs.rb +2 -2
  74. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_regions.rb +2 -2
  75. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_reserved_instances.rb +1 -1
  76. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_security_groups.rb +2 -2
  77. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_snapshots.rb +4 -4
  78. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/describe_volumes.rb +2 -2
  79. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/modify_instance_attribute.rb +1 -1
  80. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/compute/revoke_security_group_ingress.rb +41 -29
  81. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/describe_load_balancers.rb +3 -3
  82. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +1 -1
  83. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/add_instance_groups.rb +46 -0
  84. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/add_job_flow_steps.rb +49 -0
  85. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/describe_job_flows.rb +108 -0
  86. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/modify_instance_groups.rb +40 -0
  87. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/run_job_flow.rb +106 -0
  88. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/set_termination_protection.rb +39 -0
  89. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/emr/terminate_job_flows.rb +37 -0
  90. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/simpledb/get_attributes.rb +2 -2
  91. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/simpledb/select.rb +1 -1
  92. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/acl_utils.rb +62 -0
  93. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_bucket_acl.rb +7 -1
  94. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_object_acl.rb +7 -1
  95. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/get_object_url.rb +2 -2
  96. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/put_bucket_acl.rb +2 -2
  97. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/put_object_acl.rb +1 -1
  98. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/ses.rb +1 -1
  99. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/simpledb.rb +2 -0
  100. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/sns.rb +3 -1
  101. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/sqs.rb +4 -2
  102. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/storage.rb +10 -2
  103. data/lib/brightbox-cli/vendor/fog/lib/fog/aws.rb +26 -1
  104. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/aws.rb +8 -4
  105. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/bluebox.rb +2 -2
  106. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/brightbox.rb +1 -1
  107. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/dnsimple.rb +1 -1
  108. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/dnsmadeeasy.rb +1 -1
  109. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/ecloud.rb +1 -1
  110. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/glesys.rb +1 -1
  111. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/go_grid.rb +1 -1
  112. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/google.rb +1 -1
  113. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/libvirt.rb +1 -1
  114. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/linode.rb +2 -2
  115. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/local.rb +1 -1
  116. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/new_servers.rb +1 -1
  117. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/ninefold.rb +2 -2
  118. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/openstack.rb +1 -1
  119. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/rackspace.rb +3 -3
  120. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/slicehost.rb +1 -1
  121. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/stormondemand.rb +1 -1
  122. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/virtual_box.rb +1 -1
  123. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/vmfusion.rb +1 -1
  124. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/voxel.rb +1 -1
  125. data/lib/brightbox-cli/vendor/fog/lib/fog/bin/zerigo.rb +1 -1
  126. data/lib/brightbox-cli/vendor/fog/lib/fog/bin.rb +1 -1
  127. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/compute.rb +2 -0
  128. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/cloud_ip.rb +10 -2
  129. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/server.rb +11 -3
  130. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/models/compute/server_group.rb +9 -0
  131. data/lib/brightbox-cli/vendor/fog/lib/fog/brightbox/requests/compute/update_firewall_rule.rb +13 -0
  132. data/lib/brightbox-cli/vendor/fog/lib/fog/core/connection.rb +1 -1
  133. data/lib/brightbox-cli/vendor/fog/lib/fog/core/credentials.rb +3 -3
  134. data/lib/brightbox-cli/vendor/fog/lib/fog/core/deprecation.rb +2 -2
  135. data/lib/brightbox-cli/vendor/fog/lib/fog/core/logger.rb +8 -3
  136. data/lib/brightbox-cli/vendor/fog/lib/fog/core/mock.rb +4 -0
  137. data/lib/brightbox-cli/vendor/fog/lib/fog/core/provider.rb +7 -2
  138. data/lib/brightbox-cli/vendor/fog/lib/fog/core/service.rb +8 -2
  139. data/lib/brightbox-cli/vendor/fog/lib/fog/dnsmadeeasy/models/dns/record.rb +3 -2
  140. data/lib/brightbox-cli/vendor/fog/lib/fog/dynect/dns.rb +25 -3
  141. data/lib/brightbox-cli/vendor/fog/lib/fog/ecloud/compute.rb +1 -1
  142. data/lib/brightbox-cli/vendor/fog/lib/fog/go_grid/requests/compute/grid_server_power.rb +1 -1
  143. data/lib/brightbox-cli/vendor/fog/lib/fog/google/models/storage/file.rb +1 -1
  144. data/lib/brightbox-cli/vendor/fog/lib/fog/google/requests/storage/get_object_url.rb +2 -2
  145. data/lib/brightbox-cli/vendor/fog/lib/fog/google/storage.rb +1 -1
  146. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/models/storage/file.rb +8 -6
  147. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/models/storage/files.rb +3 -2
  148. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/requests/storage/head_namespace.rb +20 -0
  149. data/lib/brightbox-cli/vendor/fog/lib/fog/ninefold/storage.rb +4 -2
  150. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/models/compute/server.rb +7 -1
  151. data/lib/brightbox-cli/vendor/fog/lib/fog/openstack/requests/compute/create_server.rb +6 -11
  152. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/load_balancers.rb +1 -0
  153. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/callback.rb +1 -1
  154. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/record.rb +1 -1
  155. data/lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/dns/zone.rb +1 -1
  156. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/dns.rb +1 -0
  157. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/record.rb +7 -3
  158. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/models/dns/zone.rb +1 -1
  159. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/dns/create_record.rb +8 -2
  160. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/dns/get_record.rb +17 -5
  161. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/parsers/dns/get_records.rb +10 -2
  162. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/requests/dns/get_record.rb +1 -1
  163. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/requests/dns/get_records.rb +7 -8
  164. data/lib/brightbox-cli/vendor/fog/lib/fog/slicehost/requests/dns/update_record.rb +43 -0
  165. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/balancers.rb +1 -1
  166. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/configs.rb +1 -1
  167. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/images.rb +1 -1
  168. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/servers.rb +1 -1
  169. data/lib/brightbox-cli/vendor/fog/lib/fog/storm_on_demand/models/compute/templates.rb +1 -1
  170. data/lib/brightbox-cli/vendor/fog/lib/fog/terremark/vcloud.rb +1 -1
  171. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/compute.rb +41 -23
  172. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/models/compute/server.rb +19 -0
  173. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/models/compute/servers.rb +8 -2
  174. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/datacenters.rb +34 -0
  175. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +83 -10
  176. data/lib/brightbox-cli/vendor/fog/lib/fog/vsphere/requests/compute/vm_clone.rb +76 -37
  177. data/lib/brightbox-cli/vendor/fog/lib/fog.rb +1 -1
  178. data/lib/brightbox-cli/vendor/fog/tests/aws/models/cloud_watch/alarm_data_tests.rb +8 -6
  179. data/lib/brightbox-cli/vendor/fog/tests/aws/models/cloud_watch/alarm_history_tests.rb +3 -1
  180. data/lib/brightbox-cli/vendor/fog/tests/aws/models/compute/security_group_tests.rb +15 -10
  181. data/lib/brightbox-cli/vendor/fog/tests/aws/models/elb/model_tests.rb +4 -4
  182. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/cloud_formation/stack_tests.rb +14 -0
  183. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/instance_tests.rb +16 -1
  184. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/security_group_tests.rb +251 -32
  185. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/compute/tag_tests.rb +2 -2
  186. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/emr/helper.rb +172 -0
  187. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/emr/instance_group_tests.rb +106 -0
  188. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/emr/job_flow_tests.rb +88 -0
  189. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/storage/acl_utils_tests.rb +209 -0
  190. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/storage/bucket_tests.rb +80 -55
  191. data/lib/brightbox-cli/vendor/fog/tests/aws/requests/storage/object_tests.rb +42 -24
  192. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/account_tests.rb +11 -6
  193. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/api_client_tests.rb +23 -12
  194. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/cloud_ip_tests.rb +29 -20
  195. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/helper.rb +70 -14
  196. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/image_tests.rb +17 -14
  197. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/interface_tests.rb +3 -2
  198. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/load_balancer_tests.rb +57 -11
  199. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_group_tests.rb +29 -22
  200. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_tests.rb +38 -21
  201. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/server_type_tests.rb +7 -6
  202. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/user_tests.rb +11 -16
  203. data/lib/brightbox-cli/vendor/fog/tests/brightbox/requests/compute/zone_tests.rb +7 -6
  204. data/lib/brightbox-cli/vendor/fog/tests/compute/helper.rb +1 -1
  205. data/lib/brightbox-cli/vendor/fog/tests/core/credential_tests.rb +2 -2
  206. data/lib/brightbox-cli/vendor/fog/tests/core/mocking_tests.rb +60 -0
  207. data/lib/brightbox-cli/vendor/fog/tests/dns/models/record_tests.rb +4 -2
  208. data/lib/brightbox-cli/vendor/fog/tests/dns/models/records_tests.rb +4 -2
  209. data/lib/brightbox-cli/vendor/fog/tests/dns/models/zone_tests.rb +3 -1
  210. data/lib/brightbox-cli/vendor/fog/tests/dns/models/zones_tests.rb +4 -2
  211. data/lib/brightbox-cli/vendor/fog/tests/glesys/requests/compute/helper.rb +4 -2
  212. data/lib/brightbox-cli/vendor/fog/tests/glesys/requests/compute/server_tests.rb +1 -1
  213. data/lib/brightbox-cli/vendor/fog/tests/helper.rb +4 -0
  214. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/dns/dns_tests.rb +16 -12
  215. data/lib/brightbox-cli/vendor/fog/tests/rackspace/requests/dns/records_tests.rb +13 -11
  216. data/lib/brightbox-cli/vendor/fog/tests/slicehost/requests/dns/dns_tests.rb +58 -11
  217. data/lib/brightbox-cli/vendor/fog/tests/vsphere/compute_tests.rb +18 -10
  218. data/lib/brightbox-cli/vendor/fog/tests/vsphere/requests/compute/vm_clone_tests.rb +3 -7
  219. data/lib/brightbox-cli/version.rb +1 -1
  220. data/lib/brightbox_cli.rb +1 -0
  221. data/spec/fixtures/vcr_cassettes/list_server_groups.yml +37 -6
  222. data/spec/nilable_hash_spec.rb +30 -0
  223. metadata +48 -18
  224. data/lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/storage/hash_to_acl.rb +0 -44
@@ -0,0 +1,88 @@
1
+ Shindo.tests('AWS::EMR | job flows', ['aws', 'emr']) do
2
+
3
+ pending if Fog.mocking?
4
+
5
+ @job_flow_name = "fog_job_flow_#{Time.now.to_f.to_s.gsub('.','')}"
6
+
7
+ @job_flow_options = {
8
+ 'Instances' => {
9
+ 'MasterInstanceType' => 'm1.small',
10
+ 'SlaveInstanceType' => 'm1.small',
11
+ 'InstanceCount' => 2,
12
+ 'Placement' => {
13
+ 'AvailabilityZone' => 'us-east-1a'
14
+ },
15
+ 'KeepJobFlowAliveWhenNoSteps' => false,
16
+ 'TerminationProtected' => false,
17
+ 'HadoopVersion' => '0.20'
18
+ }
19
+ }
20
+
21
+ @step_name = "fog_job_flow_step_#{Time.now.to_f.to_s.gsub('.','')}"
22
+
23
+ @job_flow_steps = {
24
+ 'Steps' => [{
25
+ 'Name' => @step_name,
26
+ 'ActionOnFailure' => 'CONTINUE',
27
+ 'HadoopJarStep' => {
28
+ 'Jar' => 'FakeJar',
29
+ 'MainClass' => 'FakeMainClass',
30
+ 'Args' => ['arg1', 'arg2']
31
+ }
32
+ }]
33
+ }
34
+
35
+ @job_flow_id = nil
36
+
37
+ tests('success') do
38
+
39
+ tests("#run_job_flow").formats(AWS::EMR::Formats::RUN_JOB_FLOW) do
40
+ pending if Fog.mocking?
41
+
42
+ result = AWS[:emr].run_job_flow(@job_flow_name, @job_flow_options).body
43
+ @job_flow_id = result['JobFlowId']
44
+
45
+ result
46
+ end
47
+
48
+ tests("#add_job_flow_steps").formats(AWS::EMR::Formats::BASIC) do
49
+ pending if Fog.mocking?
50
+
51
+ result = AWS[:emr].add_job_flow_steps(@job_flow_id, @job_flow_steps).body
52
+
53
+ result
54
+ end
55
+
56
+ tests("#set_termination_protection").formats(AWS::EMR::Formats::BASIC) do
57
+
58
+ result = AWS[:emr].set_termination_protection(true, 'JobFlowIds' => [@job_flow_id]).body
59
+
60
+ test("protected?") do
61
+ res = AWS[:emr].describe_job_flows('JobFlowIds' => [@job_flow_id]).body
62
+ jf = res['JobFlows'].first
63
+
64
+ jf['Instances']['TerminationProtected'] == 'true'
65
+ end
66
+
67
+ result
68
+ end
69
+
70
+ tests("#terminate_job_flow").formats(AWS::EMR::Formats::BASIC) do
71
+ pending if Fog.mocking?
72
+ AWS[:emr].set_termination_protection(false, 'JobFlowIds' => [@job_flow_id])
73
+
74
+ result = AWS[:emr].terminate_job_flows('JobFlowIds' => [@job_flow_id]).body
75
+
76
+ result
77
+ end
78
+
79
+ tests("#describe_job_flows").formats(AWS::EMR::Formats::SIMPLE_DESCRIBE_JOB_FLOW) do
80
+ pending if Fog.mocking?
81
+
82
+ result = AWS[:emr].describe_job_flows('JobFlowIds' => [@job_flow_id]).body
83
+
84
+ result
85
+ end
86
+
87
+ end
88
+ end
@@ -0,0 +1,209 @@
1
+ require 'fog/aws/requests/storage/acl_utils'
2
+
3
+ Shindo.tests('Fog::Storage::AWS | ACL utils', [:aws]) do
4
+ tests(".hash_to_acl") do
5
+ tests(".hash_to_acl({}) at xpath //AccessControlPolicy").returns("", "has an empty AccessControlPolicy") do
6
+ xml = Fog::Storage::AWS.hash_to_acl({})
7
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy").first.content.chomp
8
+ end
9
+
10
+ tests(".hash_to_acl({}) at xpath //AccessControlPolicy/Owner").returns(nil, "does not have an Owner element") do
11
+ xml = Fog::Storage::AWS.hash_to_acl({})
12
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/Owner").first
13
+ end
14
+
15
+ tests(".hash_to_acl('Owner' => {}) at xpath //AccessControlPolicy/Owner").returns(nil, "does not have an Owner element") do
16
+ xml = Fog::Storage::AWS.hash_to_acl('Owner' => {})
17
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/Owner").first
18
+ end
19
+
20
+ tests(".hash_to_acl('Owner' => {'ID' => 'abcdef0123456789'}) at xpath //AccessControlPolicy/Owner/ID").returns("abcdef0123456789", "returns the Owner ID") do
21
+ xml = Fog::Storage::AWS.hash_to_acl('Owner' => {'ID' => 'abcdef0123456789'})
22
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/Owner/ID").first.content
23
+ end
24
+
25
+ tests(".hash_to_acl('Owner' => {'DisplayName' => 'bob'}) at xpath //AccessControlPolicy/Owner/ID").returns(nil, "does not have an Owner ID element") do
26
+ xml = Fog::Storage::AWS.hash_to_acl('Owner' => {'DisplayName' => 'bob'})
27
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/Owner/ID").first
28
+ end
29
+
30
+ tests(".hash_to_acl('Owner' => {'DisplayName' => 'bob'}) at xpath //AccessControlPolicy/Owner/DisplayName").returns("bob", "returns the Owner DisplayName") do
31
+ xml = Fog::Storage::AWS.hash_to_acl('Owner' => {'DisplayName' => 'bob'})
32
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/Owner/DisplayName").first.content
33
+ end
34
+
35
+ tests(".hash_to_acl('Owner' => {'ID' => 'abcdef0123456789'}) at xpath //AccessControlPolicy/Owner/DisplayName").returns(nil, "does not have an Owner DisplayName element") do
36
+ xml = Fog::Storage::AWS.hash_to_acl('Owner' => {'ID' => 'abcdef0123456789'})
37
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/Owner/DisplayName").first
38
+ end
39
+
40
+ tests(".hash_to_acl({}) at xpath //AccessControlPolicy/AccessControlList").returns(nil, "has no AccessControlList") do
41
+ xml = Fog::Storage::AWS.hash_to_acl({})
42
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlPolicy").first
43
+ end
44
+
45
+ acl = {
46
+ 'AccessControlList' => [
47
+ {
48
+ 'Grantee' => {
49
+ 'ID' => 'abcdef0123456789',
50
+ 'DisplayName' => 'bob'
51
+ },
52
+ 'Permission' => 'READ'
53
+ }
54
+ ]
55
+ }
56
+
57
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Grantee").returns("CanonicalUser", "has an xsi:type of CanonicalUser") do
58
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
59
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Grantee").first.attributes["type"].value
60
+ end
61
+
62
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Grantee/ID").returns("abcdef0123456789", "returns the Grantee ID") do
63
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
64
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Grantee/ID").first.content
65
+ end
66
+
67
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Grantee/DisplayName").returns("bob", "returns the Grantee DisplayName") do
68
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
69
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Grantee/DisplayName").first.content
70
+ end
71
+
72
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Permission").returns("READ", "returns the Grantee Permission") do
73
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
74
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Permission").first.content
75
+ end
76
+
77
+ acl = {
78
+ 'AccessControlList' => [
79
+ {
80
+ 'Grantee' => {
81
+ 'EmailAddress' => 'user@example.com'
82
+ },
83
+ 'Permission' => 'FULL_CONTROL'
84
+ }
85
+ ]
86
+ }
87
+
88
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Grantee").returns("AmazonCustomerByEmail", "has an xsi:type of AmazonCustomerByEmail") do
89
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
90
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Grantee").first.attributes["type"].value
91
+ end
92
+
93
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Grantee/EmailAddress").returns("user@example.com", "returns the Grantee EmailAddress") do
94
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
95
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Grantee/EmailAddress").first.content
96
+ end
97
+
98
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Permission").returns("FULL_CONTROL", "returns the Grantee Permission") do
99
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
100
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Permission").first.content
101
+ end
102
+
103
+ acl = {
104
+ 'AccessControlList' => [
105
+ {
106
+ 'Grantee' => {
107
+ 'URI' => 'http://acs.amazonaws.com/groups/global/AllUsers'
108
+ },
109
+ 'Permission' => 'WRITE'
110
+ }
111
+ ]
112
+ }
113
+
114
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Grantee").returns("Group", "has an xsi:type of Group") do
115
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
116
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Grantee").first.attributes["type"].value
117
+ end
118
+
119
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Grantee/URI").returns("http://acs.amazonaws.com/groups/global/AllUsers", "returns the Grantee URI") do
120
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
121
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Grantee/URI").first.content
122
+ end
123
+
124
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Permission").returns("WRITE", "returns the Grantee Permission") do
125
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
126
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Permission").first.content
127
+ end
128
+
129
+ acl = {
130
+ 'AccessControlList' => [
131
+ {
132
+ 'Grantee' => {
133
+ 'ID' => 'abcdef0123456789',
134
+ 'DisplayName' => 'bob'
135
+ },
136
+ 'Permission' => 'READ'
137
+ },
138
+ {
139
+ 'Grantee' => {
140
+ 'EmailAddress' => 'user@example.com'
141
+ },
142
+ 'Permission' => 'FULL_CONTROL'
143
+ },
144
+ {
145
+ 'Grantee' => {
146
+ 'URI' => 'http://acs.amazonaws.com/groups/global/AllUsers'
147
+ },
148
+ 'Permission' => 'WRITE'
149
+ }
150
+ ]
151
+ }
152
+
153
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant").returns(3, "has three elements") do
154
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
155
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant").size
156
+ end
157
+
158
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Grantee/ID").returns("abcdef0123456789", "returns the first Grant's Grantee ID") do
159
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
160
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Grantee/ID").first.content
161
+ end
162
+
163
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Grantee/EmailAddress").returns("user@example.com", "returns the second Grant's Grantee EmailAddress") do
164
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
165
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Grantee/EmailAddress").first.content
166
+ end
167
+
168
+ tests(".hash_to_acl(#{acl.inspect}) at xpath //AccessControlPolicy/AccessControlList/Grant/Grantee/URI").returns("http://acs.amazonaws.com/groups/global/AllUsers", "returns the third Grant's Grantee URI") do
169
+ xml = Fog::Storage::AWS.hash_to_acl(acl)
170
+ Nokogiri::XML(xml).xpath("//AccessControlPolicy/AccessControlList/Grant/Grantee/URI").first.content
171
+ end
172
+ end
173
+
174
+ tests(".acl_to_hash") do
175
+ acl_xml = <<-XML
176
+ <AccessControlPolicy>
177
+ <Owner>
178
+ <ID>2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0</ID>
179
+ <DisplayName>me</DisplayName>
180
+ </Owner>
181
+ <AccessControlList>
182
+ <Grant>
183
+ <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
184
+ <ID>2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0</ID>
185
+ <DisplayName>me</DisplayName>
186
+ </Grantee>
187
+ <Permission>FULL_CONTROL</Permission>
188
+ </Grant>
189
+ </AccessControlList>
190
+ </AccessControlPolicy>
191
+ XML
192
+
193
+ tests(".acl_to_hash(#{acl_xml.inspect})").returns({
194
+ "Owner" => {
195
+ "DisplayName" => "me",
196
+ "ID" => "2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0"
197
+ },
198
+ "AccessControlList" => [{
199
+ "Grantee" => {
200
+ "DisplayName" => "me",
201
+ "ID" => "2744ccd10c7533bd736ad890f9dd5cab2adb27b07d500b9493f29cdc420cb2e0"
202
+ },
203
+ "Permission" => "FULL_CONTROL"
204
+ }]
205
+ }, 'returns hash of ACL XML') do
206
+ Fog::Storage::AWS.acl_to_hash(acl_xml)
207
+ end
208
+ end
209
+ end
@@ -1,4 +1,5 @@
1
1
  Shindo.tests('Fog::Storage[:aws] | bucket requests', [:aws]) do
2
+ @aws_bucket_name = 'fogbuckettests-' + Time.now.to_i.to_s(32)
2
3
 
3
4
  tests('success') do
4
5
 
@@ -33,30 +34,31 @@ Shindo.tests('Fog::Storage[:aws] | bucket requests', [:aws]) do
33
34
  }
34
35
  }
35
36
 
36
- tests("#put_bucket('fogbuckettests')").succeeds do
37
- Fog::Storage[:aws].put_bucket('fogbuckettests')
37
+ tests("#put_bucket('#{@aws_bucket_name}')").succeeds do
38
+ Fog::Storage[:aws].put_bucket(@aws_bucket_name)
39
+ @aws_owner = Fog::Storage[:aws].get_bucket_acl(Fog::Storage[:aws].directories.first.key).body['Owner']
38
40
  end
39
41
 
40
42
  tests("#get_service").formats(@service_format) do
41
43
  Fog::Storage[:aws].get_service.body
42
44
  end
43
45
 
44
- file = Fog::Storage[:aws].directories.get('fogbuckettests').files.create(:body => 'y', :key => 'x')
46
+ file = Fog::Storage[:aws].directories.get(@aws_bucket_name).files.create(:body => 'y', :key => 'x')
45
47
 
46
- tests("#get_bucket('fogbuckettests)").formats(@bucket_format) do
47
- Fog::Storage[:aws].get_bucket('fogbuckettests').body
48
+ tests("#get_bucket('#{@aws_bucket_name}')").formats(@bucket_format) do
49
+ Fog::Storage[:aws].get_bucket(@aws_bucket_name).body
48
50
  end
49
51
 
50
52
  file.destroy
51
53
 
52
- file1 = Fog::Storage[:aws].directories.get('fogbuckettests').files.create(:body => 'a', :key => 'a/a1/file1')
53
- file2 = Fog::Storage[:aws].directories.get('fogbuckettests').files.create(:body => 'ab', :key => 'a/file2')
54
- file3 = Fog::Storage[:aws].directories.get('fogbuckettests').files.create(:body => 'abc', :key => 'b/file3')
55
- file4 = Fog::Storage[:aws].directories.get('fogbuckettests').files.create(:body => 'abcd', :key => 'file4')
54
+ file1 = Fog::Storage[:aws].directories.get(@aws_bucket_name).files.create(:body => 'a', :key => 'a/a1/file1')
55
+ file2 = Fog::Storage[:aws].directories.get(@aws_bucket_name).files.create(:body => 'ab', :key => 'a/file2')
56
+ file3 = Fog::Storage[:aws].directories.get(@aws_bucket_name).files.create(:body => 'abc', :key => 'b/file3')
57
+ file4 = Fog::Storage[:aws].directories.get(@aws_bucket_name).files.create(:body => 'abcd', :key => 'file4')
56
58
 
57
- tests("#get_bucket('fogbuckettests')") do
59
+ tests("#get_bucket('#{@aws_bucket_name}')") do
58
60
  before do
59
- @bucket = Fog::Storage[:aws].get_bucket('fogbuckettests')
61
+ @bucket = Fog::Storage[:aws].get_bucket(@aws_bucket_name)
60
62
  end
61
63
 
62
64
  tests(".body['Contents'].map{|n| n['Key']}").returns(["a/a1/file1", "a/file2", "b/file3", "file4"]) do
@@ -72,9 +74,9 @@ Shindo.tests('Fog::Storage[:aws] | bucket requests', [:aws]) do
72
74
  end
73
75
  end
74
76
 
75
- tests("#get_bucket('fogbuckettests', 'delimiter' => '/')") do
77
+ tests("#get_bucket('#{@aws_bucket_name}', 'delimiter' => '/')") do
76
78
  before do
77
- @bucket = Fog::Storage[:aws].get_bucket('fogbuckettests', 'delimiter' => '/')
79
+ @bucket = Fog::Storage[:aws].get_bucket(@aws_bucket_name, 'delimiter' => '/')
78
80
  end
79
81
 
80
82
  tests(".body['Contents'].map{|n| n['Key']}").returns(['file4']) do
@@ -86,9 +88,9 @@ Shindo.tests('Fog::Storage[:aws] | bucket requests', [:aws]) do
86
88
  end
87
89
  end
88
90
 
89
- tests("#get_bucket('fogbuckettests', 'delimiter' => '/', 'prefix' => 'a/')") do
91
+ tests("#get_bucket('#{@aws_bucket_name}', 'delimiter' => '/', 'prefix' => 'a/')") do
90
92
  before do
91
- @bucket = Fog::Storage[:aws].get_bucket('fogbuckettests', 'delimiter' => '/', 'prefix' => 'a/')
93
+ @bucket = Fog::Storage[:aws].get_bucket(@aws_bucket_name, 'delimiter' => '/', 'prefix' => 'a/')
92
94
  end
93
95
 
94
96
  tests(".body['Contents'].map{|n| n['Key']}").returns(['a/file2']) do
@@ -102,63 +104,84 @@ Shindo.tests('Fog::Storage[:aws] | bucket requests', [:aws]) do
102
104
 
103
105
  file1.destroy; file2.destroy; file3.destroy; file4.destroy
104
106
 
105
- tests("#get_bucket_location('fogbuckettests)").formats('LocationConstraint' => NilClass) do
106
- Fog::Storage[:aws].get_bucket_location('fogbuckettests').body
107
+ tests("#get_bucket_location('#{@aws_bucket_name}')").formats('LocationConstraint' => NilClass) do
108
+ Fog::Storage[:aws].get_bucket_location(@aws_bucket_name).body
107
109
  end
108
110
 
109
- tests("#get_request_payment('fogbuckettests')").formats('Payer' => String) do
110
- Fog::Storage[:aws].get_request_payment('fogbuckettests').body
111
+ tests("#get_request_payment('#{@aws_bucket_name}')").formats('Payer' => String) do
112
+ Fog::Storage[:aws].get_request_payment(@aws_bucket_name).body
111
113
  end
112
114
 
113
- tests("#put_request_payment('fogbuckettests', 'Requester')").succeeds do
114
- Fog::Storage[:aws].put_request_payment('fogbuckettests', 'Requester')
115
+ tests("#put_request_payment('#{@aws_bucket_name}', 'Requester')").succeeds do
116
+ Fog::Storage[:aws].put_request_payment(@aws_bucket_name, 'Requester')
115
117
  end
116
118
 
117
- tests("#put_bucket_website('fogbuckettests', 'index.html')").succeeds do
119
+ tests("#put_bucket_website('#{@aws_bucket_name}', 'index.html')").succeeds do
118
120
  pending if Fog.mocking?
119
- Fog::Storage[:aws].put_bucket_website('fogbuckettests', 'index.html')
121
+ Fog::Storage[:aws].put_bucket_website(@aws_bucket_name, 'index.html')
120
122
  end
121
123
 
122
- tests("#delete_bucket_website('fogbuckettests')").succeeds do
123
- pending if Fog.mocking?
124
- Fog::Storage[:aws].delete_bucket_website('fogbuckettests')
125
- end
126
-
127
- tests("#delete_bucket('fogbuckettests')").succeeds do
128
- Fog::Storage[:aws].delete_bucket('fogbuckettests')
124
+ tests("#put_bucket_acl('#{@aws_bucket_name}', 'private')").succeeds do
125
+ Fog::Storage[:aws].put_bucket_acl(@aws_bucket_name, 'private')
129
126
  end
130
127
 
131
- tests("#put_bucket_acl('fogbuckettests', 'private')").succeeds do
132
- Fog::Storage[:aws].put_bucket_acl('fogbuckettests', 'private')
128
+ acl = {
129
+ 'Owner' => @aws_owner,
130
+ 'AccessControlList' => [
131
+ {
132
+ 'Grantee' => @aws_owner,
133
+ 'Permission' => "FULL_CONTROL"
134
+ }
135
+ ]
136
+ }
137
+ tests("#put_bucket_acl('#{@aws_bucket_name}', hash with id)").returns(acl) do
138
+ Fog::Storage[:aws].put_bucket_acl(@aws_bucket_name, acl)
139
+ Fog::Storage[:aws].get_bucket_acl(@aws_bucket_name).body
133
140
  end
134
141
 
135
- tests("#put_bucket_acl('fogbuckettests', hash)").returns(true) do
136
- Fog::Storage[:aws].put_bucket_acl('fogbuckettests', {
137
- 'Owner' => { 'ID' => "8a6925ce4adf5f21c32aa379004fef", 'DisplayName' => "mtd@amazon.com" },
142
+ tests("#put_bucket_acl('#{@aws_bucket_name}', hash with email)").returns({
143
+ 'Owner' => @aws_owner,
144
+ 'AccessControlList' => [
145
+ {
146
+ 'Grantee' => { 'ID' => 'f62f0218873cfa5d56ae9429ae75a592fec4fd22a5f24a20b1038a7db9a8f150', 'DisplayName' => 'mtd' },
147
+ 'Permission' => "FULL_CONTROL"
148
+ }
149
+ ]
150
+ }) do
151
+ pending if Fog.mocking?
152
+ Fog::Storage[:aws].put_bucket_acl(@aws_bucket_name, {
153
+ 'Owner' => @aws_owner,
138
154
  'AccessControlList' => [
139
- {
140
- 'Grantee' => { 'ID' => "8a6925ce4adf588a4532142d3f74dd8c71fa124b1ddee97f21c32aa379004fef", 'DisplayName' => "mtd@amazon.com" },
141
- 'Permission' => "FULL_CONTROL"
155
+ {
156
+ 'Grantee' => { 'EmailAddress' => 'mtd@amazon.com' },
157
+ 'Permission' => "FULL_CONTROL"
142
158
  }
143
159
  ]
144
160
  })
145
- Fog::Storage[:aws].get_bucket_acl('fogbuckettests').body == <<-BODY
146
- <AccessControlPolicy>
147
- <Owner>
148
- <ID>8a6925ce4adf5f21c32aa379004fef</ID>
149
- <DisplayName>mtd@amazon.com</DisplayName>
150
- </Owner>
151
- <AccessControlList>
152
- <Grant>
153
- <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
154
- <ID>8a6925ce4adf588a4532142d3f74dd8c71fa124b1ddee97f21c32aa379004fef</ID>
155
- <DisplayName>mtd@amazon.com</DisplayName>
156
- </Grantee>
157
- <Permission>FULL_CONTROL</Permission>
158
- </Grant>
159
- </AccessControlList>
160
- </AccessControlPolicy>
161
- BODY
161
+ Fog::Storage[:aws].get_bucket_acl(@aws_bucket_name).body
162
+ end
163
+
164
+ acl = {
165
+ 'Owner' => @aws_owner,
166
+ 'AccessControlList' => [
167
+ {
168
+ 'Grantee' => { 'URI' => 'http://acs.amazonaws.com/groups/global/AllUsers' },
169
+ 'Permission' => "FULL_CONTROL"
170
+ }
171
+ ]
172
+ }
173
+ tests("#put_bucket_acl('#{@aws_bucket_name}', hash with uri)").returns(acl) do
174
+ Fog::Storage[:aws].put_bucket_acl(@aws_bucket_name, acl)
175
+ Fog::Storage[:aws].get_bucket_acl(@aws_bucket_name).body
176
+ end
177
+
178
+ tests("#delete_bucket_website('#{@aws_bucket_name}')").succeeds do
179
+ pending if Fog.mocking?
180
+ Fog::Storage[:aws].delete_bucket_website(@aws_bucket_name)
181
+ end
182
+
183
+ tests("#delete_bucket('#{@aws_bucket_name}')").succeeds do
184
+ Fog::Storage[:aws].delete_bucket(@aws_bucket_name)
162
185
  end
163
186
 
164
187
  end
@@ -201,4 +224,6 @@ BODY
201
224
 
202
225
  end
203
226
 
227
+ # don't keep the bucket around
228
+ Fog::Storage[:aws].delete_bucket(@aws_bucket_name) rescue nil
204
229
  end
@@ -1,6 +1,6 @@
1
1
  Shindo.tests('AWS::Storage | object requests', ['aws']) do
2
-
3
- @directory = Fog::Storage[:aws].directories.create(:key => 'fogobjecttests')
2
+ @directory = Fog::Storage[:aws].directories.create(:key => 'fogobjecttests-' + Time.now.to_i.to_s(32))
3
+ @aws_owner = Fog::Storage[:aws].get_bucket_acl(@directory.key).body['Owner']
4
4
 
5
5
  tests('success') do
6
6
 
@@ -34,32 +34,50 @@ Shindo.tests('AWS::Storage | object requests', ['aws']) do
34
34
  Fog::Storage[:aws].put_object_acl(@directory.identity, 'fog_object', 'private')
35
35
  end
36
36
 
37
- tests("#put_object_acl('#{@directory.identity}', 'fog_object', hash)").returns(true) do
37
+ acl = {
38
+ 'Owner' => @aws_owner,
39
+ 'AccessControlList' => [
40
+ {
41
+ 'Grantee' => @aws_owner,
42
+ 'Permission' => "FULL_CONTROL"
43
+ }
44
+ ]}
45
+ tests("#put_object_acl('#{@directory.identity}', 'fog_object', hash with id)").returns(acl) do
46
+ Fog::Storage[:aws].put_object_acl(@directory.identity, 'fog_object', acl)
47
+ Fog::Storage[:aws].get_object_acl(@directory.identity, 'fog_object').body
48
+ end
49
+
50
+ tests("#put_object_acl('#{@directory.identity}', 'fog_object', hash with email)").returns({
51
+ 'Owner' => @aws_owner,
52
+ 'AccessControlList' => [
53
+ {
54
+ 'Grantee' => { 'ID' => 'f62f0218873cfa5d56ae9429ae75a592fec4fd22a5f24a20b1038a7db9a8f150', 'DisplayName' => 'mtd' },
55
+ 'Permission' => "FULL_CONTROL"
56
+ }
57
+ ]}) do
58
+ pending if Fog.mocking?
38
59
  Fog::Storage[:aws].put_object_acl(@directory.identity, 'fog_object', {
39
- 'Owner' => { 'ID' => "8a6925ce4adf5f21c32aa379004fef", 'DisplayName' => "mtd@amazon.com" },
60
+ 'Owner' => @aws_owner,
40
61
  'AccessControlList' => [
41
- {
42
- 'Grantee' => { 'ID' => "8a6925ce4adf588a4532142d3f74dd8c71fa124b1ddee97f21c32aa379004fef", 'DisplayName' => "mtd@amazon.com" },
43
- 'Permission' => "FULL_CONTROL"
62
+ {
63
+ 'Grantee' => { 'EmailAddress' => 'mtd@amazon.com' },
64
+ 'Permission' => "FULL_CONTROL"
44
65
  }
45
66
  ]})
46
- Fog::Storage[:aws].get_object_acl(@directory.identity, 'fog_object').body == <<-BODY
47
- <AccessControlPolicy>
48
- <Owner>
49
- <ID>8a6925ce4adf5f21c32aa379004fef</ID>
50
- <DisplayName>mtd@amazon.com</DisplayName>
51
- </Owner>
52
- <AccessControlList>
53
- <Grant>
54
- <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser">
55
- <ID>8a6925ce4adf588a4532142d3f74dd8c71fa124b1ddee97f21c32aa379004fef</ID>
56
- <DisplayName>mtd@amazon.com</DisplayName>
57
- </Grantee>
58
- <Permission>FULL_CONTROL</Permission>
59
- </Grant>
60
- </AccessControlList>
61
- </AccessControlPolicy>
62
- BODY
67
+ Fog::Storage[:aws].get_object_acl(@directory.identity, 'fog_object').body
68
+ end
69
+
70
+ acl = {
71
+ 'Owner' => @aws_owner,
72
+ 'AccessControlList' => [
73
+ {
74
+ 'Grantee' => { 'URI' => 'http://acs.amazonaws.com/groups/global/AllUsers' },
75
+ 'Permission' => "FULL_CONTROL"
76
+ }
77
+ ]}
78
+ tests("#put_object_acl('#{@directory.identity}', 'fog_object', hash with uri)").returns(acl) do
79
+ Fog::Storage[:aws].put_object_acl(@directory.identity, 'fog_object', acl)
80
+ Fog::Storage[:aws].get_object_acl(@directory.identity, 'fog_object').body
63
81
  end
64
82
 
65
83
  tests("#delete_object('#{@directory.identity}', 'fog_object')").succeeds do
@@ -2,20 +2,25 @@ Shindo.tests('Fog::Compute[:brightbox] | account requests', ['brightbox']) do
2
2
 
3
3
  tests('success') do
4
4
 
5
- tests("#get_account").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
5
+ tests("#get_account") do
6
6
  pending if Fog.mocking?
7
- Fog::Compute[:brightbox].get_account
7
+ result = Fog::Compute[:brightbox].get_account
8
+ formats(Brightbox::Compute::Formats::Full::ACCOUNT) { result }
9
+ test("ftp password is blanked") { result["library_ftp_password"].nil? }
8
10
  end
9
11
 
10
12
  update_options = {:name => "Fog@#{Time.now.iso8601}"}
11
- tests("#update_account(#{update_options.inspect})").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
13
+ tests("#update_account(#{update_options.inspect})") do
12
14
  pending if Fog.mocking?
13
- Fog::Compute[:brightbox].update_account(update_options)
15
+ result = Fog::Compute[:brightbox].update_account(update_options)
16
+ formats(Brightbox::Compute::Formats::Full::ACCOUNT) { result }
14
17
  end
15
18
 
16
- tests("#reset_ftp_password_account").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
19
+ tests("#reset_ftp_password_account") do
17
20
  pending if Fog.mocking?
18
- Fog::Compute[:brightbox].reset_ftp_password_account
21
+ result = Fog::Compute[:brightbox].reset_ftp_password_account
22
+ formats(Brightbox::Compute::Formats::Full::ACCOUNT) { result }
23
+ test("new ftp password is visible") { ! result["library_ftp_password"].nil? }
19
24
  end
20
25
 
21
26
  end