Dduvall has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/166913

Change subject: Restore compatibility with vagrant 1.4
......................................................................

Restore compatibility with vagrant 1.4

The v2 plugin API was subtly changed in Vagrant 1.5 to accept command
options such as `primary: false` as a second argument to `command` but
it remains unsupported in previous Vagrant versions. This workaround
backports the support albeit by simply dropping the given options.

Bug: 71878
Change-Id: Id67a7d96be812ac6ac453a4675ddc2f056300ef4
---
M lib/mediawiki-vagrant.rb
1 file changed, 17 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/13/166913/1

diff --git a/lib/mediawiki-vagrant.rb b/lib/mediawiki-vagrant.rb
index fb2b8ac..5e0ac53 100644
--- a/lib/mediawiki-vagrant.rb
+++ b/lib/mediawiki-vagrant.rb
@@ -1,5 +1,18 @@
 module MediaWikiVagrant
   class Plugin < Vagrant.plugin('2')
+    class << self
+      # Overrides command for older Vagrant versions that don't support command
+      # options despite claiming compatibility with the v2 plugin API. Note
+      # that any provided options are simply ignored when run against Vagrant
+      # <= 1.4.
+      #
+      def command(name = Vagrant::Plugin::V2::Plugin::UNSET_VALUE, options = 
{}, &blk)
+        super
+      rescue ArgumentError
+        super(name, &blk)
+      end
+    end
+
     name 'MediaWiki-Vagrant'
 
     command 'roles' do
@@ -32,25 +45,25 @@
       GitUpdates
     end
 
-    command('list-roles', primary: false) do
+    command 'list-roles', primary: false do
       # deprecated in favor of `vagrant roles list`
       require 'mediawiki-vagrant/roles/list'
       Roles::List
     end
 
-    command('reset-roles', primary: false) do
+    command 'reset-roles', primary: false do
       # deprecated in favor of `vagrant roles reset`
       require 'mediawiki-vagrant/roles/reset'
       Roles::Reset
     end
 
-    command('enable-role', primary: false) do
+    command 'enable-role', primary: false do
       # deprecated in favor of `vagrant roles enable`
       require 'mediawiki-vagrant/roles/enable'
       Roles::Enable
     end
 
-    command('disable-role', primary: false) do
+    command 'disable-role', primary: false do
       # deprecated in favor of `vagrant roles disable`
       require 'mediawiki-vagrant/roles/disable'
       Roles::Disable

-- 
To view, visit https://gerrit.wikimedia.org/r/166913
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id67a7d96be812ac6ac453a4675ddc2f056300ef4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Dduvall <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to