agiledivider / vagrant-hostsupdater

MIT License
1.15k stars 129 forks source link

Uninitialized constant VagrantPlugins::Aws #161

Closed gdepaepe closed 6 years ago

gdepaepe commented 6 years ago

I am running vagrant 2.0.3 on Ubuntu 16.04. I installed vagrant-hostsupdater v1.1.1 using "git clone" (when I use "vagrant plugin install ", I get v1.0.2)

I get the following error:

HostsUpdater.rb:225:in `getAwsPublicIp': uninitialized constant VagrantPlugins::Aws (NameError)

when I comment out line 225 in the rb file, everything works fine.

Vagrantfile:

config.vm.define "aws", autostart: false do |aws| aws.vm.box = "dummy" aws.vm.provider "aws" do |a, override| a.region = "us-east-1" a.ami = "ami-346b9c49" a.instance_type= "t1.micro" a.security_groups = ["default"] a.tags = { "Name" => "vagrant-aws" } a.elastic_ip = true a.keypair_name = "geert" override.ssh.private_key_path = ".ssh/test.pem" override.ssh.username = "ubuntu" end aws.vm.hostname = "vagrant-aws" end

kentr commented 6 years ago

I'm also getting this. Writing a PR now.

~/.vagrant.d/gems/2.3.4/gems/vagrant-hostsupdater-1.1.1.160/lib/vagrant-hostsupdater/HostsUpdater.rb:225:in `getAwsPublicIp': uninitialized constant VagrantPlugins::Aws (NameError)
    from ~/.vagrant.d/gems/2.3.4/gems/vagrant-hostsupdater-1.1.1.160/lib/vagrant-hostsupdater/HostsUpdater.rb:17:in `getIps'
    from ~/.vagrant.d/gems/2.3.4/gems/vagrant-hostsupdater-1.1.1.160/lib/vagrant-hostsupdater/HostsUpdater.rb:186:in `removeFromSshKnownHosts'
    from ~/.vagrant.d/gems/2.3.4/gems/vagrant-hostsupdater-1.1.1.160/lib/vagrant-hostsupdater/HostsUpdater.rb:115:in `removeHostEntries'
    from ~/.vagrant.d/gems/2.3.4/gems/vagrant-hostsupdater-1.1.1.160/lib/vagrant-hostsupdater/Action/RemoveHosts.rb:19:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/2.3.4/gems/vagrant-auto_network-1.0.2/lib/auto_network/action/release.rb:19:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/builtin/provisioner_cleanup.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/2.3.4/gems/vagrant-aws-0.7.2/lib/vagrant-aws/action/terminate_instance.rb:33:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/2.3.4/gems/vagrant-aws-0.7.2/lib/vagrant-aws/action/elb_deregister_instance.rb:19:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/2.3.4/gems/vagrant-aws-0.7.2/lib/vagrant-aws/action/connect_aws.rb:43:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/2.3.4/gems/vagrant-auto_network-1.0.2/lib/auto_network/action/request.rb:24:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from ~/.vagrant.d/gems/2.3.4/gems/vagrant-hostsupdater-1.1.1.160/lib/vagrant-hostsupdater/Action/CacheHosts.rb:14:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/machine.rb:227:in `action_raw'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/machine.rb:202:in `block in action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/environment.rb:631:in `lock'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/machine.rb:188:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/machine.rb:188:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/destroy/command.rb:31:in `block in execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/plugin/v2/command.rb:235:in `block in with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/plugin/v2/command.rb:229:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/plugin/v2/command.rb:229:in `with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/plugins/commands/destroy/command.rb:30:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/lib/vagrant/environment.rb:308:in `cli'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.9.8/bin/vagrant:138:in `<main>'