From 175c40765a3e82217abb3ce96276e2bc85d62ae4 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sat, 28 Sep 2013 03:12:56 -0300 Subject: [PATCH] Fall back to `dnsmasq` leases file if not able to fetch IP with `lxc-attach` Closes GH-118 --- CHANGELOG.md | 7 ++++--- lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a58dc24..83ee258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ ## [0.6.1](https://github.com/fgrehm/vagrant-lxc/compare/v0.6.0...master) (unreleased) - IMPROVEMENTS: +IMPROVEMENTS: - - New base boxes with support for lxc 1.0+ - - Make sure lxc templates are executable prior to `lxc-create` [#128](https://github.com/fgrehm/vagrant-lxc/issues/128) + - Fall back to `dnsmasq` leases file if not able to fetch IP with `lxc-attach` [#118](https://github.com/fgrehm/vagrant-lxc/issues/118) + - Make sure lxc templates are executable prior to `lxc-create` [#128](https://github.com/fgrehm/vagrant-lxc/issues/128) + - New base boxes with support for lxc 1.0+ BUG FIXES: diff --git a/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb b/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb index 650f261..45e6231 100644 --- a/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb +++ b/lib/vagrant-lxc/action/fetch_ip_with_lxc_attach.rb @@ -12,6 +12,9 @@ module Vagrant def call(env) env[:machine_ip] ||= assigned_ip(env) + rescue LXC::Errors::ExecuteError + @logger.info 'Unable to fetch IP with `lxc-attach`!' + ensure @app.call(env) end