Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Replace uuidtools with SecureRandom.uuid #85

Merged
merged 1 commit into from

2 participants

@ankurcha

No need to add a dependency uuid generation. SecureRandom is a part of ruby 1.9.x

Ankur Chauhan Replace uuidtools with securerandom, no need to add a dependency uuid…
… generation is a part of ruby 1.9.x
b379696
@pmenglund pmenglund merged commit 1ed3b91 into cloudfoundry:master

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 18, 2013
  1. Replace uuidtools with securerandom, no need to add a dependency uuid…

    Ankur Chauhan authored
    … generation is a part of ruby 1.9.x
This page is out of date. Refresh to see the latest.
Showing with 65 additions and 87 deletions.
  1. +0 −11 Gemfile.lock
  2. +0 −1  blobstore_client/blobstore_client.gemspec
  3. +2 −2 blobstore_client/lib/blobstore_client/base.rb
  4. +1 −1  blobstore_client/lib/blobstore_client/local_client.rb
  5. +2 −2 blobstore_client/lib/blobstore_client/s3_blobstore_client.rb
  6. +1 −1  blobstore_client/lib/blobstore_client/swift_blobstore_client.rb
  7. +0 −1  bosh_agent/bosh_agent.gemspec
  8. +3 −3 bosh_agent/lib/bosh_agent.rb
  9. +1 −1  bosh_agent/lib/bosh_agent/handler.rb
  10. +0 −1  bosh_aws_bootstrap/bosh_aws_bootstrap.gemspec
  11. +1 −1  bosh_aws_bootstrap/lib/bosh_aws_bootstrap/route53.rb
  12. +0 −1  bosh_aws_cpi/bosh_aws_cpi.gemspec
  13. +1 −1  bosh_aws_cpi/lib/cloud/aws.rb
  14. +1 −1  bosh_aws_cpi/lib/cloud/aws/cloud.rb
  15. +1 −1  bosh_aws_cpi/lib/cloud/aws/stemcell_creator.rb
  16. +1 −1  bosh_aws_cpi/spec/unit/create_vm_spec.rb
  17. +1 −1  bosh_deployer/lib/deployer.rb
  18. +1 −1  bosh_deployer/lib/deployer/instance_manager.rb
  19. +1 −1  bosh_deployer/spec/unit/aws/instance_manager_spec.rb
  20. +1 −1  bosh_deployer/spec/unit/instance_mananager_spec.rb
  21. +1 −1  bosh_deployer/spec/unit/openstack/instance_manager_spec.rb
  22. +1 −1  bosh_deployer/spec/unit/vcloud/instance_manager_spec.rb
  23. +0 −1  bosh_encryption/bosh_encryption.gemspec
  24. +2 −2 bosh_encryption/lib/encryption/encryption_handler.rb
  25. +0 −1  bosh_openstack_cpi/bosh_openstack_cpi.gemspec
  26. +1 −1  bosh_openstack_cpi/lib/cloud/openstack.rb
  27. +1 −1  bosh_openstack_cpi/lib/cloud/openstack/cloud.rb
  28. +3 −3 bosh_openstack_cpi/spec/unit/create_disk_spec.rb
  29. +3 −3 bosh_openstack_cpi/spec/unit/create_stemcell_spec.rb
  30. +5 −5 bosh_openstack_cpi/spec/unit/create_vm_spec.rb
  31. +0 −1  bosh_vcloud_cpi/bosh_vcloud_cpi.gemspec
  32. +1 −1  bosh_vcloud_cpi/lib/cloud/vcloud.rb
  33. +2 −2 bosh_vcloud_cpi/lib/cloud/vcloud/cloud.rb
  34. +1 −1  bosh_vcloud_cpi/spec/spec_helper.rb
  35. +0 −1  bosh_vsphere_cpi/bosh_vsphere_cpi.gemspec
  36. +1 −1  bosh_vsphere_cpi/lib/cloud/vsphere.rb
  37. +1 −1  bosh_vsphere_cpi/lib/cloud/vsphere/cloud.rb
  38. +0 −1  director/director.gemspec
  39. +1 −1  director/lib/director.rb
  40. +1 −1  director/lib/director/api/deployment_manager.rb
  41. +1 −1  director/lib/director/api/resource_manager.rb
  42. +1 −1  director/lib/director/api/stemcell_manager.rb
  43. +1 −1  director/lib/director/cloudcheck_helper.rb
  44. +2 −2 director/lib/director/config.rb
  45. +1 −1  director/lib/director/deployment_plan/template.rb
  46. +1 −1  director/lib/director/instance_updater.rb
  47. +1 −1  director/lib/director/lock.rb
  48. +1 −1  director/lib/director/nats_rpc.rb
  49. +1 −1  director/lib/director/resource_pool_updater.rb
  50. +1 −1  director/lib/director/vm_creator.rb
  51. +4 −4 director/spec/cpi/cpi_test_spec.rb
  52. +1 −1  director/spec/unit/api_controller_spec.rb
  53. +0 −1  health_monitor/health_monitor.gemspec
  54. +1 −1  health_monitor/lib/health_monitor.rb
  55. +1 −1  health_monitor/lib/health_monitor/events/base.rb
  56. +1 −1  ruby_vcloud_sdk/spec/spec_helper.rb
  57. +2 −2 simple_blobstore_server/lib/simple_blobstore_server.rb
  58. +0 −1  simple_blobstore_server/simple_blobstore_server.gemspec
View
11 Gemfile.lock
@@ -22,7 +22,6 @@ PATH
httpclient (= 2.2.4)
multi_json (~> 1.1)
ruby-atmos-pure (~> 1.0.5)
- uuidtools (~> 2.1.2)
PATH
remote: bosh_agent
@@ -42,7 +41,6 @@ PATH
sinatra (~> 1.2.8)
sys-filesystem (~> 1.1.0)
thin (~> 1.5.0)
- uuidtools (~> 2.1.3)
yajl-ruby (~> 1.1.0)
PATH
@@ -52,7 +50,6 @@ PATH
bosh_aws_cpi (~> 1.5.0.pre2)
bosh_cli (~> 1.5.0.pre2)
bosh_deployer (~> 1.5.0.pre2)
- uuidtools (~> 2.1.3)
PATH
remote: bosh_aws_cpi
@@ -62,7 +59,6 @@ PATH
bosh_common (~> 1.5.0.pre2)
bosh_cpi (~> 1.5.0.pre2)
httpclient (= 2.2.4)
- uuidtools (~> 2.1.3)
yajl-ruby (>= 0.8.2)
PATH
@@ -112,7 +108,6 @@ PATH
specs:
bosh_encryption (1.5.0.pre2)
gibberish (~> 1.2.0)
- uuidtools (~> 2.1.3)
yajl-ruby (~> 1.1.0)
PATH
@@ -123,7 +118,6 @@ PATH
bosh_cpi (~> 1.5.0.pre2)
fog (~> 1.10.0)
httpclient (= 2.2.4)
- uuidtools (~> 2.1.3)
yajl-ruby (>= 0.8.2)
PATH
@@ -144,7 +138,6 @@ PATH
bosh_common (~> 1.5.0.pre2)
bosh_cpi (~> 1.5.0.pre2)
ruby_vcloud_sdk (~> 1.5.0.pre2)
- uuidtools (~> 2.1)
yajl-ruby (>= 0.8.2)
PATH
@@ -156,7 +149,6 @@ PATH
membrane (~> 0.0.2)
ruby_vim_sdk (~> 1.5.0.pre2)
sequel (~> 3.43.0)
- uuidtools (~> 2.1.3)
PATH
remote: director
@@ -183,7 +175,6 @@ PATH
sequel (~> 3.43.0)
sinatra (~> 1.2.8)
thin (~> 1.5.0)
- uuidtools (~> 2.1.3)
yajl-ruby (~> 1.1.0)
PATH
@@ -197,7 +188,6 @@ PATH
nats (~> 0.4.28)
sinatra (~> 1.2.8)
thin (~> 1.5.0)
- uuidtools (~> 2.1.3)
yajl-ruby (~> 1.1.0)
PATH
@@ -239,7 +229,6 @@ PATH
simple_blobstore_server (1.5.0.pre2)
sinatra (~> 1.2.8)
thin (~> 1.5.0)
- uuidtools (~> 2.1)
GEM
remote: https://rubygems.org/
View
1  blobstore_client/blobstore_client.gemspec
@@ -24,6 +24,5 @@ Gem::Specification.new do |s|
s.add_dependency "httpclient", "=2.2.4"
s.add_dependency "multi_json", "~> 1.1"
s.add_dependency "ruby-atmos-pure", "~> 1.0.5"
- s.add_dependency "uuidtools", "~> 2.1.2"
s.add_dependency "bosh_common", "~>#{version}"
end
View
4 blobstore_client/lib/blobstore_client/base.rb
@@ -1,7 +1,7 @@
# Copyright (c) 2009-2012 VMware, Inc.
require 'tmpdir'
-require 'uuidtools'
+require 'securerandom'
module Bosh
module Blobstore
@@ -97,7 +97,7 @@ def object_exists?(oid)
end
def temp_path
- path = File.join(Dir::tmpdir, "temp-path-#{UUIDTools::UUID.random_create}")
+ path = File.join(Dir::tmpdir, "temp-path-#{SecureRandom.uuid}")
begin
yield path if block_given?
path
View
2  blobstore_client/lib/blobstore_client/local_client.rb
@@ -15,7 +15,7 @@ def initialize(options)
protected
def create_file(id, file)
- id ||= UUIDTools::UUID.random_create.to_s
+ id ||= SecureRandom.uuid
dst = object_file_path(id)
raise BlobstoreError, "object id #{id} is already in use" if File.exist?(dst)
File.open(dst, 'w') do |fh|
View
4 blobstore_client/lib/blobstore_client/s3_blobstore_client.rb
@@ -4,7 +4,7 @@
require "digest/sha1"
require "base64"
require "aws"
-require "uuidtools"
+require "securerandom"
module Bosh
module Blobstore
@@ -166,7 +166,7 @@ def encrypt_file(file)
end
def generate_object_id
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def read_only?
View
2  blobstore_client/lib/blobstore_client/swift_blobstore_client.rb
@@ -89,7 +89,7 @@ def delete_object(object_id)
private
def generate_object_id
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def encode_object_id(object_id, public_url = nil)
View
1  bosh_agent/bosh_agent.gemspec
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
s.add_dependency 'posix-spawn', "~>0.3.6"
s.add_dependency 'ruby-atmos-pure', "~>1.0.5"
s.add_dependency 'thin', "~>1.5.0"
- s.add_dependency 'uuidtools', "~>2.1.3"
s.add_dependency 'yajl-ruby', "~>1.1.0"
s.add_dependency 'blobstore_client', "~>#{version}"
s.add_dependency 'bosh_common', "~>#{version}"
View
6 bosh_agent/lib/bosh_agent.rb
@@ -10,15 +10,15 @@ module Bosh
require "nats/client"
require "yajl"
-require "uuidtools"
+require "securerandom"
require "ostruct"
require "posix/spawn"
require "monit_api"
require "fileutils"
require "resolv"
require "ipaddr"
-require 'httpclient'
-require 'sigar'
+require "httpclient"
+require "sigar"
require "common/exec"
require "common/properties"
View
2  bosh_agent/lib/bosh_agent/handler.rb
@@ -284,7 +284,7 @@ def process(processor, args)
end
def generate_agent_task_id
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def post_prepare_network_change
View
1  bosh_aws_bootstrap/bosh_aws_bootstrap.gemspec
@@ -20,6 +20,5 @@ Gem::Specification.new do |s|
s.add_dependency "bosh_cli", "~>#{version}"
s.add_dependency "bosh_aws_cpi", "~>#{version}"
s.add_dependency "bosh_deployer", "~>#{version}"
- s.add_dependency "uuidtools", "~>2.1.3"
end
View
2  bosh_aws_bootstrap/lib/bosh_aws_bootstrap/route53.rb
@@ -94,7 +94,7 @@ def aws_route53
end
def generate_unique_name
- ::UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
end
end
View
1  bosh_aws_cpi/bosh_aws_cpi.gemspec
@@ -23,6 +23,5 @@ Gem::Specification.new do |s|
s.add_dependency "bosh_common", "~>#{version}"
s.add_dependency "bosh_cpi", "~>#{version}"
s.add_dependency "httpclient", "=2.2.4"
- s.add_dependency "uuidtools", "~>2.1.3"
s.add_dependency "yajl-ruby", ">=0.8.2"
end
View
2  bosh_aws_cpi/lib/cloud/aws.rb
@@ -9,7 +9,7 @@ module AwsCloud; end
require "pp"
require "set"
require "tmpdir"
-require "uuidtools"
+require "securerandom"
require "yajl"
require "common/exec"
View
2  bosh_aws_cpi/lib/cloud/aws/cloud.rb
@@ -561,7 +561,7 @@ def default_ec2_endpoint
def initial_agent_settings(agent_id, network_spec, environment, preformatted, root_device_name, agent_properties)
settings = {
"vm" => {
- "name" => "vm-#{UUIDTools::UUID.random_create}"
+ "name" => "vm-#{SecureRandom.uuid}"
},
"agent_id" => agent_id,
"networks" => network_spec,
View
2  bosh_aws_cpi/lib/cloud/aws/stemcell_creator.rb
@@ -93,7 +93,7 @@ def image_params(snapshot_id)
aki = AKIPicker.new(region).pick(architecture, root_device_name)
params = {
- :name => "BOSH-#{UUIDTools::UUID.random_create}",
+ :name => "BOSH-#{SecureRandom.uuid}",
:architecture => architecture,
:kernel_id => aki,
:root_device_name => root_device_name,
View
2  bosh_aws_cpi/spec/unit/create_vm_spec.rb
@@ -92,7 +92,7 @@
it "should update the registry settings with the new instance" do
network_configurator.stub(:configure)
Bosh::AwsCloud::ResourceWait.stub(:for_instance).with(instance: instance, state: :running)
- UUIDTools::UUID.stub(:random_create).and_return("rand0m")
+ SecureRandom.stub(:uuid).and_return("rand0m")
agent_settings = {
"vm" => {
View
2  bosh_deployer/lib/deployer.rb
@@ -10,7 +10,7 @@ module Bosh; module Deployer; end; end
require "cloud"
require "logger"
require "tmpdir"
-require "uuidtools"
+require "securerandom"
require "yaml"
require "yajl"
require "common/common"
View
2  bosh_deployer/lib/deployer/instance_manager.rb
@@ -477,7 +477,7 @@ def load_spec(file)
end
def generate_unique_name
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def load_state(name)
View
2  bosh_deployer/spec/unit/aws/instance_manager_spec.rb
@@ -9,7 +9,7 @@
@dir = Dir.mktmpdir("bdim_spec")
@config = YAML.load_file(spec_asset("test-bootstrap-config-aws.yml"))
@config["dir"] = @dir
- @config["name"] = "spec-#{UUIDTools::UUID.random_create.to_s}"
+ @config["name"] = "spec-#{SecureRandom.uuid}"
@config["logging"] = { "file" => "#{@dir}/bmim.log" }
@deployer = Bosh::Deployer::InstanceManager.create(@config)
@cloud = mock("cloud")
View
2  bosh_deployer/spec/unit/instance_mananager_spec.rb
@@ -9,7 +9,7 @@
@dir = Dir.mktmpdir("bdim_spec")
@config = YAML.load_file(spec_asset("test-bootstrap-config.yml"))
@config["dir"] = @dir
- @config["name"] = "spec-#{UUIDTools::UUID.random_create.to_s}"
+ @config["name"] = "spec-#{SecureRandom.uuid}"
@config["logging"] = {"file" => "#{@dir}/bmim.log"}
@deployer = Bosh::Deployer::InstanceManager.create(@config)
@cloud = mock("cloud")
View
2  bosh_deployer/spec/unit/openstack/instance_manager_spec.rb
@@ -9,7 +9,7 @@
@dir = Dir.mktmpdir("bdim_spec")
@config = YAML.load_file(spec_asset("test-bootstrap-config-openstack.yml"))
@config["dir"] = @dir
- @config["name"] = "spec-#{UUIDTools::UUID.random_create.to_s}"
+ @config["name"] = "spec-#{SecureRandom.uuid}"
@config["logging"] = { "file" => "#{@dir}/bmim.log" }
@deployer = Bosh::Deployer::InstanceManager.create(@config)
@cloud = mock("cloud")
View
2  bosh_deployer/spec/unit/vcloud/instance_manager_spec.rb
@@ -9,7 +9,7 @@
@dir = Dir.mktmpdir("bdim_spec")
@config = YAML.load_file(spec_asset("test-bootstrap-config-vcloud.yml"))
@config["dir"] = @dir
- @config["name"] = "spec-#{UUIDTools::UUID.random_create.to_s}"
+ @config["name"] = "spec-#{SecureRandom.uuid}"
@config["logging"] = { "file" => "#{@dir}/bmim.log" }
@deployer = Bosh::Deployer::InstanceManager.create(@config)
@cloud = mock("cloud")
View
1  bosh_encryption/bosh_encryption.gemspec
@@ -19,6 +19,5 @@ Gem::Specification.new do |s|
s.require_path = "lib"
s.add_dependency "gibberish", "~>1.2.0"
- s.add_dependency "uuidtools", "~>2.1.3"
s.add_dependency "yajl-ruby", "~>1.1.0"
end
View
4 bosh_encryption/lib/encryption/encryption_handler.rb
@@ -2,7 +2,7 @@
require "securerandom"
require "gibberish"
-require "uuidtools"
+require "securerandom"
require "yajl"
module Bosh
@@ -78,7 +78,7 @@ def decrypt(encrypted_data)
end
def start_session
- @session_id = UUIDTools::UUID.random_create.to_s
+ @session_id = SecureRandom.uuid
end
def verify_signature(data)
View
1  bosh_openstack_cpi/bosh_openstack_cpi.gemspec
@@ -24,6 +24,5 @@ Gem::Specification.new do |s|
s.add_dependency "bosh_common", "~>#{version}"
s.add_dependency "bosh_cpi", "~>#{version}"
s.add_dependency "httpclient", "=2.2.4"
- s.add_dependency "uuidtools", "~>2.1.3"
s.add_dependency "yajl-ruby", ">=0.8.2"
end
View
2  bosh_openstack_cpi/lib/cloud/openstack.rb
@@ -11,7 +11,7 @@ module OpenStackCloud; end
require "pp"
require "set"
require "tmpdir"
-require "uuidtools"
+require "securerandom"
require "yajl"
require "common/thread_pool"
View
2  bosh_openstack_cpi/lib/cloud/openstack/cloud.rb
@@ -525,7 +525,7 @@ def ensure_same_availability_zone(disks, default)
#
# @return [String] Unique name
def generate_unique_name
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
##
View
6 bosh_openstack_cpi/spec/unit/create_disk_spec.rb
@@ -6,7 +6,7 @@
describe Bosh::OpenStackCloud::Cloud do
it "creates an OpenStack volume" do
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
disk_params = {
:name => "volume-#{unique_name}",
:description => "",
@@ -26,7 +26,7 @@
end
it "rounds up disk size" do
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
disk_params = {
:name => "volume-#{unique_name}",
:description => "",
@@ -56,7 +56,7 @@
end
it "puts disk in the same AZ as a server" do
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
disk_params = {
:name => "volume-#{unique_name}",
:description => "",
View
6 bosh_openstack_cpi/spec/unit/create_stemcell_spec.rb
@@ -13,7 +13,7 @@
it "creates stemcell using an image without kernel nor ramdisk" do
image = double("image", :id => "i-bar", :name => "i-bar")
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
image_params = {
:name => "BOSH-#{unique_name}",
:disk_format => "ami",
@@ -43,7 +43,7 @@
image = double("image", :id => "i-bar", :name => "i-bar")
kernel = double("image", :id => "k-img-id", :name => "k-img-id")
ramdisk = double("image", :id => "r-img-id", :name => "r-img-id")
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
kernel_params = {
:name => "BOSH-#{unique_name}-AKI",
:disk_format => "aki",
@@ -102,7 +102,7 @@
image = double("image", :id => "i-bar", :name => "i-bar")
kernel = double("image", :id => "k-img-id", :name => "k-img-id")
ramdisk = double("image", :id => "r-img-id", :name => "r-img-id")
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
kernel_params = {
:name => "BOSH-#{unique_name}-AKI",
:disk_format => "aki",
View
10 bosh_openstack_cpi/spec/unit/create_vm_spec.rb
@@ -43,7 +43,7 @@ def openstack_params(unique_name, user_data, security_groups=[], nics=[])
end
it "creates an OpenStack server and polls until it's ready" do
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
user_data = {
"registry" => {
"endpoint" => "http://registry:3333"
@@ -82,7 +82,7 @@ def openstack_params(unique_name, user_data, security_groups=[], nics=[])
end
it "passes dns servers in server user data when present" do
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
user_data = {
"registry" => {
@@ -127,7 +127,7 @@ def openstack_params(unique_name, user_data, security_groups=[], nics=[])
end
it "creates an OpenStack server with security groups" do
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
user_data = {
"registry" => {
"endpoint" => "http://registry:3333"
@@ -169,7 +169,7 @@ def openstack_params(unique_name, user_data, security_groups=[], nics=[])
end
it "creates an OpenStack server with nic for dynamic network" do
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
user_data = {
"registry" => {
"endpoint" => "http://registry:3333"
@@ -211,7 +211,7 @@ def openstack_params(unique_name, user_data, security_groups=[], nics=[])
end
it "creates an OpenStack server with nic for manual network" do
- unique_name = UUIDTools::UUID.random_create.to_s
+ unique_name = SecureRandom.uuid
user_data = {
"registry" => {
"endpoint" => "http://registry:3333"
View
1  bosh_vcloud_cpi/bosh_vcloud_cpi.gemspec
@@ -20,6 +20,5 @@ Gem::Specification.new do |s|
s.add_dependency "bosh_common", "~>#{version}"
s.add_dependency "bosh_cpi", "~>#{version}"
s.add_dependency "ruby_vcloud_sdk", "~>#{version}"
- s.add_dependency "uuidtools", "~>2.1"
s.add_dependency "yajl-ruby", ">=0.8.2"
end
View
2  bosh_vcloud_cpi/lib/cloud/vcloud.rb
@@ -1,6 +1,6 @@
require "common/thread_pool"
require "common/thread_formatter"
-require "uuidtools"
+require "securerandom"
require "forwardable"
autoload :VCloudCloud, "cloud/vcloud/cloud"
View
4 bosh_vcloud_cpi/lib/cloud/vcloud/cloud.rb
@@ -7,7 +7,7 @@
require "digest/sha1"
require "fileutils"
require "logger"
-require "uuidtools"
+require "securerandom"
require "yajl"
require "const"
require "thread"
@@ -450,7 +450,7 @@ def destroy_client
end
def generate_unique_name
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def log_exception(op, e)
View
2  bosh_vcloud_cpi/spec/spec_helper.rb
@@ -33,7 +33,7 @@ def test_deployment_manifest
end
def generate_unique_name
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def compare_xml(a, b)
View
1  bosh_vsphere_cpi/bosh_vsphere_cpi.gemspec
@@ -22,5 +22,4 @@ Gem::Specification.new do |s|
s.add_dependency "membrane", "~>0.0.2"
s.add_dependency "ruby_vim_sdk", "~>#{version}"
s.add_dependency "sequel", "~>3.43.0"
- s.add_dependency "uuidtools", "~>2.1.3"
end
View
2  bosh_vsphere_cpi/lib/cloud/vsphere.rb
@@ -1,6 +1,6 @@
require "common/thread_pool"
require "common/thread_formatter"
-require "uuidtools"
+require "securerandom"
autoload :VSphereCloud, "cloud/vsphere/cloud"
View
2  bosh_vsphere_cpi/lib/cloud/vsphere/cloud.rb
@@ -927,7 +927,7 @@ def take_snapshot(vm, name)
end
def generate_unique_name
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def create_disk_config_spec(datastore, file_name, controller_key, space, options = {})
View
1  director/director.gemspec
@@ -40,7 +40,6 @@ Gem::Specification.new do |s|
s.add_dependency "sequel", "~>3.43.0"
s.add_dependency "sinatra", "~>1.2.8"
s.add_dependency "thin", "~>1.5.0"
- s.add_dependency "uuidtools", "~>2.1.3"
s.add_dependency "yajl-ruby", "~>1.1.0"
s.bindir = 'bin'
View
2  director/lib/director.rb
@@ -28,7 +28,7 @@ module Director
require "resque"
require "sequel"
require "sinatra/base"
-require "uuidtools"
+require "securerandom"
require "yajl"
require "nats/client"
require "securerandom"
View
2  director/lib/director/api/deployment_manager.rb
@@ -19,7 +19,7 @@ def find_by_name(name)
end
def create_deployment(user, deployment_manifest, options = {})
- random_name = "deployment-#{UUIDTools::UUID.random_create}"
+ random_name = "deployment-#{SecureRandom.uuid}"
deployment_manifest_file = File.join(Dir::tmpdir, random_name)
write_file(deployment_manifest_file, deployment_manifest)
View
2  director/lib/director/api/resource_manager.rb
@@ -15,7 +15,7 @@ def initialize
# @return [String] path to the contents of the blobstore id
def get_resource_path(id)
blobstore_resource(id) do |blobstore|
- random_name = "resource-#{UUIDTools::UUID.random_create}"
+ random_name = "resource-#{SecureRandom.uuid}"
path = File.join(Dir.tmpdir, random_name)
File.open(path, "w") do |f|
View
2  director/lib/director/api/stemcell_manager.rb
@@ -23,7 +23,7 @@ def stemcell_exists?(name, version)
end
def create_stemcell(user, stemcell)
- random_name = "stemcell-#{UUIDTools::UUID.random_create}"
+ random_name = "stemcell-#{SecureRandom.uuid}"
stemcell_file = File.join(Dir::tmpdir, random_name)
write_file(stemcell_file, stemcell)
task = create_task(user, :update_stemcell, "create stemcell")
View
2  director/lib/director/cloudcheck_helper.rb
@@ -203,7 +203,7 @@ def find_stemcell(stemcell_spec)
end
def generate_agent_id
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
end
View
4 director/lib/director/config.rb
@@ -79,7 +79,7 @@ def configure(config)
File.open(state_json, File::RDWR|File::CREAT, 0644) do |file|
file.flock(File::LOCK_EX)
state = Yajl::Parser.parse(file.read) || {}
- @uuid = state["uuid"] ||= UUIDTools::UUID.random_create.to_s
+ @uuid = state["uuid"] ||= SecureRandom.uuid
file.rewind
file.write(Yajl::Encoder.encode(state))
file.flush
@@ -90,7 +90,7 @@ def configure(config)
@logger.info("Starting BOSH Director: #{VERSION} (#{@revision})")
- @process_uuid = UUIDTools::UUID.random_create.to_s
+ @process_uuid = SecureRandom.uuid
@nats_uri = config["mbus"]
@cloud_options = config["cloud"]
View
2  director/lib/director/deployment_plan/template.rb
@@ -37,7 +37,7 @@ def bind_models
# Downloads template blob to a given path
# @return [String] Path to downloaded blob
def download_blob
- uuid = UUIDTools::UUID.random_create
+ uuid = SecureRandom.uuid
path = File.join(Dir.tmpdir, "template-#{uuid}")
if Config.blobstore.nil?
View
2  director/lib/director/instance_updater.rb
@@ -434,7 +434,7 @@ def agent
end
def generate_agent_id
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
# Returns an array of wait times distributed
View
2  director/lib/director/lock.rb
@@ -16,7 +16,7 @@ class TimeoutError < StandardError; end
# lock
def initialize(name, opts = {})
@name = name
- @id = UUIDTools::UUID.random_create.to_s
+ @id = SecureRandom.uuid
@timeout = opts[:timeout] || 1.0
@expiration = opts[:expiration] || 10.0
@logger = Config.logger
View
2  director/lib/director/nats_rpc.rb
@@ -47,7 +47,7 @@ def cancel_request(request_id)
end
def generate_request_id
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
end
View
2  director/lib/director/resource_pool_updater.rb
@@ -170,7 +170,7 @@ def reserve_networks
end
def generate_agent_id
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def each_idle_vm
View
2  director/lib/director/vm_creator.rb
@@ -60,7 +60,7 @@ def delete_vm(vm_cid)
end
def self.generate_agent_id
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def logger
View
8 director/spec/cpi/cpi_test_spec.rb
@@ -69,7 +69,7 @@ def check_vm_tools(vm_cid)
# deploy a dummy VM to verify the stemcell.
def stemcell_check
result = false
- agent_id = UUIDTools::UUID.random_create.to_s
+ agent_id = SecureRandom.uuid
vm_ip = get_ip
net_config = {'test' => {'cloud_properties' => @net_conf['cloud_properties'],
'netmask' => @net_conf['netmask'],
@@ -160,7 +160,7 @@ def stemcell_check
end
it "create/delete a VM" do
- agent_id = UUIDTools::UUID.random_create.to_s
+ agent_id = SecureRandom.uuid
vm_ip = get_ip
net_config = {'test' => {'cloud_properties' => @net_conf['cloud_properties'],
'netmask' => @net_conf['netmask'],
@@ -177,7 +177,7 @@ def stemcell_check
end
it "reconfigure vm ip address" do
- agent_id = UUIDTools::UUID.random_create.to_s
+ agent_id = SecureRandom.uuid
vm_ip_a = get_ip
vm_ip_b = get_ip
net_config = {'test' => {'cloud_properties' => @net_conf['cloud_properties'],
@@ -214,7 +214,7 @@ def stemcell_check
it "disk operations create/delete attach/detach and move disk" do
disk_cid = nil
2.times do
- agent_id = UUIDTools::UUID.random_create.to_s
+ agent_id = SecureRandom.uuid
vm_ip = get_ip
net_config = {'test' => {'cloud_properties' => @net_conf['cloud_properties'],
'netmask' => @net_conf['netmask'],
View
2  director/spec/unit/api_controller_spec.rb
@@ -35,7 +35,7 @@ def app
it "cleans up temp file after serving it" do
tmp_file = File.join(Dir.tmpdir,
- "resource-#{UUIDTools::UUID.random_create}")
+ "resource-#{SecureRandom.uuid}")
File.open(tmp_file, "w") do |f|
f.write("some data")
View
1  health_monitor/health_monitor.gemspec
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
s.add_dependency "em-http-request", "~>0.3.0"
s.add_dependency "nats", "~>0.4.28"
s.add_dependency "yajl-ruby", "~>1.1.0"
- s.add_dependency "uuidtools", "~>2.1.3"
s.add_dependency "thin", "~>1.5.0"
s.add_dependency "sinatra", "~>1.2.8"
s.add_dependency "aws-sdk", "~>1.8.5"
View
2  health_monitor/lib/health_monitor.rb
@@ -23,7 +23,7 @@ module HealthMonitor
require "nats/client"
require "sinatra"
require "thin"
-require "uuidtools"
+require "securerandom"
require "yajl"
# Helpers
View
2  health_monitor/lib/health_monitor/events/base.rb
@@ -32,7 +32,7 @@ def self.create(kind, attributes = {})
end
event = klass.new(attributes)
- event.id = UUIDTools::UUID.random_create.to_s if event.id.nil?
+ event.id = SecureRandom.uuid if event.id.nil?
event
end
View
2  ruby_vcloud_sdk/spec/spec_helper.rb
@@ -29,7 +29,7 @@ def vcd_settings
end
def generate_unique_name
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def compare_xml(a, b)
View
4 simple_blobstore_server/lib/simple_blobstore_server.rb
@@ -6,7 +6,7 @@
require "yaml"
require "sinatra"
-require "uuidtools"
+require "securerandom"
module Bosh
module Blobstore
@@ -44,7 +44,7 @@ def get_nginx_path(object_id)
end
def generate_object_id
- UUIDTools::UUID.random_create.to_s
+ SecureRandom.uuid
end
def protected!
View
1  simple_blobstore_server/simple_blobstore_server.gemspec
@@ -17,7 +17,6 @@ Gem::Specification.new do |s|
s.files = `git ls-files -- lib/*`.split("\n") + %w(README)
s.require_path = "lib"
- s.add_dependency "uuidtools", "~>2.1"
s.add_dependency "thin", "~>1.5.0"
s.add_dependency "sinatra", "~> 1.2.8"
Something went wrong with that request. Please try again.