fix issue with vagrant-libvirt gem dependency fog-core requiring ruby newer than vagrant installs

Change-Id: I2dc813daa1b57ede9548f4dd73589537bf06d86c
diff --git a/scripts/cord-in-a-box.sh b/scripts/cord-in-a-box.sh
index 4951df2..922103a 100755
--- a/scripts/cord-in-a-box.sh
+++ b/scripts/cord-in-a-box.sh
@@ -81,13 +81,23 @@
     echo "$VAGRANT_SHA256SUM  /tmp/vagrant.deb" | sha256sum -c -
     sudo apt-get update
     sudo dpkg -i /tmp/vagrant.deb
-    sudo apt-get -y install qemu-kvm libvirt-bin libvirt-dev curl nfs-kernel-server git build-essential python-pip
+    sudo apt-get -y install qemu-kvm libvirt-bin libvirt-dev curl nfs-kernel-server git build-essential python-pip ruby2.0
     sudo adduser $USER libvirtd
     sudo pip install pyparsing python-logstash mixpanel
   fi
 
   echo "Installing vagrant plugins..."
-  vagrant plugin list | grep vagrant-libvirt || vagrant plugin install vagrant-libvirt --plugin-version 0.0.35
+  # FIXME: fix for vagrant-libvirt dependency issue that arose on 2017-04-28 - zdw
+  # vagrant plugin list | grep vagrant-libvirt || vagrant plugin install vagrant-libvirt --plugin-version 0.0.35
+  if ! vagrant plugin list | grep vagrant-libvirt
+  then
+    git clone -b remove_xmlrpc_dep https://github.com/zdw/vagrant-libvirt.git ~/vagrant-libvirt
+    cd ~/vagrant-libvirt
+    gem2.0 build vagrant-libvirt.gemspec
+    vagrant plugin install vagrant-libvirt-0.0.35.gem
+    cd ~
+  fi
+
   vagrant plugin list | grep vagrant-mutate || vagrant plugin install vagrant-mutate
 
   add_box ubuntu/trusty64
diff --git a/scripts/opencloud-in-a-box.sh b/scripts/opencloud-in-a-box.sh
index 525518c..4d53c94 100755
--- a/scripts/opencloud-in-a-box.sh
+++ b/scripts/opencloud-in-a-box.sh
@@ -74,14 +74,23 @@
     curl -o /tmp/vagrant.deb https://releases.hashicorp.com/vagrant/1.9.2/vagrant_1.9.2_x86_64.deb
     echo "$VAGRANT_SHA256SUM  /tmp/vagrant.deb" | sha256sum -c -
     sudo dpkg -i /tmp/vagrant.deb
-    sudo apt-get -y install qemu-kvm libvirt-bin libvirt-dev curl nfs-kernel-server git build-essential python-pip
+    sudo apt-get -y install qemu-kvm libvirt-bin libvirt-dev curl nfs-kernel-server git build-essential python-pip ruby2.0
     sudo adduser $USER libvirtd
     sudo pip install pyparsing python-logstash
 
     run_stage cloudlab_setup
 
     echo "Installing vagrant plugins..."
-    vagrant plugin list | grep vagrant-libvirt || vagrant plugin install vagrant-libvirt --plugin-version 0.0.35
+    # FIXME: fix for vagrant-libvirt dependency issue that arose on 2017-04-28 - zdw
+    # vagrant plugin list | grep vagrant-libvirt || vagrant plugin install vagrant-libvirt --plugin-version 0.0.35
+    if ! vagrant plugin list | grep vagrant-libvirt
+    then
+      git clone -b remove_xmlrpc_dep https://github.com/zdw/vagrant-libvirt.git ~/vagrant-libvirt
+      cd ~/vagrant-libvirt
+      gem2.0 build vagrant-libvirt.gemspec
+      vagrant plugin install vagrant-libvirt-0.0.35.gem
+      cd ~
+    fi
     vagrant plugin list | grep vagrant-mutate || vagrant plugin install vagrant-mutate
 
     add_box ubuntu/trusty64