add --count errors out
Closed this issue · 0 comments
Deleted user commented
After configuring a -new- bank, we get an error because the bank["counter"] is empty:
bin/befog add stg-loadtesters --count 10
Provisioning server 1 for bank 'stg-loadtesters'...
Provisioning server 2 for bank 'stg-loadtesters'...
Provisioning server 3 for bank 'stg-loadtesters'...
Provisioning server 4 for bank 'stg-loadtesters'...
Unexpected error
NoMethodError: undefined method `+' for nil:NilClass
/root/befog/lib/befog/commands/add.rb:85:in `generate_id'
/root/befog/lib/befog/commands/add.rb:81:in `generate_server_name'
/root/befog/lib/befog/commands/add.rb:75:in `provision_server'
/root/befog/lib/befog/commands/add.rb:54:in `provision_servers'
/root/befog/lib/befog/commands/mixins/safely.rb:8:in `safely'
/root/befog/lib/befog/commands/add.rb:51:in `provision_servers'
/root/befog/lib/befog/commands/add.rb:50:in `initialize'
/root/befog/lib/befog/commands/add.rb:50:in `new'
/root/befog/lib/befog/commands/add.rb:50:in `provision_servers'
/root/befog/lib/befog/commands/add.rb:41:in `times'
/root/befog/lib/befog/commands/add.rb:41:in `provision_servers'
/root/befog/lib/befog/commands/add.rb:35:in `run'
/root/befog/lib/befog/commands/mixins/command.rb:24:in `run'
/root/befog/lib/befog/cli.rb:54:in `run'
bin/befog:14
So, I tried adding this to add.rb as a quick and dirty test:
def generate_id
if bank["counter"]
bank["counter"] += 1
else
bank["counter"] == 1
end
end
But now get this:
bin/befog add stg-loadtesters --count 10
Provisioning server 1 for bank 'stg-loadtesters'...
Provisioning server 2 for bank 'stg-loadtesters'...
Provisioning server 3 for bank 'stg-loadtesters'...
Provisioning server 4 for bank 'stg-loadtesters'...
Provisioning server 5 for bank 'stg-loadtesters'...
Provisioning server 6 for bank 'stg-loadtesters'...
Unexpected error
Excon::Errors::SocketError: getaddrinfo: Name or service not known
/var/lib/gems/1.8/gems/excon-0.14.3/lib/excon/ssl_socket.rb:9:in `initialize'
/var/lib/gems/1.8/gems/excon-0.14.3/lib/excon/ssl_socket.rb:9:in `new'
/var/lib/gems/1.8/gems/excon-0.14.3/lib/excon/ssl_socket.rb:9:in `connect'
/var/lib/gems/1.8/gems/excon-0.14.3/lib/excon/socket.rb:16:in `initialize'
/var/lib/gems/1.8/gems/excon-0.14.3/lib/excon/ssl_socket.rb:31:in `initialize'
/var/lib/gems/1.8/gems/excon-0.14.3/lib/excon/connection.rb:344:in `new'
/var/lib/gems/1.8/gems/excon-0.14.3/lib/excon/connection.rb:344:in `socket'
/var/lib/gems/1.8/gems/excon-0.14.3/lib/excon/connection.rb:175:in `request_kernel'
/var/lib/gems/1.8/gems/excon-0.14.3/lib/excon/connection.rb:101:in `request'
/var/lib/gems/1.8/gems/fog-1.4.0/lib/fog/core/connection.rb:20:in `request'
/var/lib/gems/1.8/gems/fog-1.4.0/lib/fog/aws/compute.rb:362:in `request'
/var/lib/gems/1.8/gems/fog-1.4.0/lib/fog/aws/requests/compute/run_instances.rb:117:in `run_instances'
/var/lib/gems/1.8/gems/fog-1.4.0/lib/fog/aws/models/compute/server.rb:182:in `save'
/var/lib/gems/1.8/gems/fog-1.4.0/lib/fog/core/collection.rb:50:in `create'
/root/befog/lib/befog/commands/add.rb:74:in `provision_server'
/root/befog/lib/befog/commands/add.rb:54:in `provision_servers'
/root/befog/lib/befog/commands/mixins/safely.rb:8:in `safely'
/root/befog/lib/befog/commands/add.rb:51:in `provision_servers'
/root/befog/lib/befog/commands/add.rb:50:in `initialize'
/root/befog/lib/befog/commands/add.rb:50:in `new'
/root/befog/lib/befog/commands/add.rb:50:in `provision_servers'
/root/befog/lib/befog/commands/add.rb:41:in `times'
/root/befog/lib/befog/commands/add.rb:41:in `provision_servers'
/root/befog/lib/befog/commands/add.rb:35:in `run'
/root/befog/lib/befog/commands/mixins/command.rb:24:in `run'
/root/befog/lib/befog/cli.rb:54:in `run'
bin/befog:14
bailing out for now and just doing it with fog directly. But will try to revisit next I need another bank of servers. <3