From 5a56b72360f30702b2a8a69b1c6722540b466b3a Mon Sep 17 00:00:00 2001 From: Jef Mathiot Date: Sat, 22 Mar 2014 00:58:36 +0100 Subject: [PATCH] * Ruby >1.9 hash syntax * Improved comment on Vagrant::Registry.keys --- lib/vagrant-lxc/command/root.rb | 3 ++- lib/vagrant-lxc/command/sudoers.rb | 40 +++++++++++++++--------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/lib/vagrant-lxc/command/root.rb b/lib/vagrant-lxc/command/root.rb index c7f6f7f..cb9af66 100644 --- a/lib/vagrant-lxc/command/root.rb +++ b/lib/vagrant-lxc/command/root.rb @@ -36,7 +36,8 @@ module Vagrant opts.separator "" opts.separator "Available subcommands:" - # https://github.com/mitchellh/vagrant/commit/4194da19c60956f6e59239c0145f772be257e79d + # REFACTOR Use @subcommands.keys.sort + # https://github.com/mitchellh/vagrant/commit/4194da19c60956f6e59239c0145f772be257e79d keys = [] @subcommands.each { |key, value| keys << key } diff --git a/lib/vagrant-lxc/command/sudoers.rb b/lib/vagrant-lxc/command/sudoers.rb index 4c63bdd..0513eca 100644 --- a/lib/vagrant-lxc/command/sudoers.rb +++ b/lib/vagrant-lxc/command/sudoers.rb @@ -56,26 +56,26 @@ module Vagrant def commands [ - { :cmd => '/usr/bin/lxc-ls', :args => '' }, - { :cmd => '/usr/bin/lxc-info', :args => '' }, - { :cmd => '/usr/bin/lxc-attach', :args => '' }, - { :cmd => '/usr/bin/which', :args => 'lxc-*' }, - { :cmd => '/bin/cat', :args => '/var/lib/lxc/*' }, - { :cmd => '/bin/mkdir', :args => '/var/lib/lxc/*' }, - { :cmd => '/bin/su', :args => "root -c sed -e '*' -ibak /var/lib/lxc/*" }, - { :cmd => '/bin/su', :args => "root -c echo '*' >> /var/lib/lxc/*" }, - { :cmd => '/usr/bin/lxc-start', :args => '-d --name *' }, - { :cmd => '/bin/cp', :args => '%{BOXES}/*/lxc/lxc-template /usr/lib/lxc/templates/*' }, - { :cmd => '/bin/cp', :args => '%{BOXES}/*/lxc/lxc-template /usr/share/lxc/templates/*' }, - { :cmd => '/bin/rm', :args => '/usr/lib/lxc/templates/*' }, - { :cmd => '/bin/rm', :args => '/usr/share/lxc/templates/*' }, - { :cmd => '/bin/chmod', :args => '+x /usr/lib/lxc/*' }, - { :cmd => '/bin/chmod', :args => '+x /usr/share/lxc/*' }, - { :cmd => '/usr/bin/lxc-create', :args => '--template * --name * -- --tarball ${BOXES}/*' }, - { :cmd => '/bin/rm', :args => '-rf /var/lib/lxc/*/rootfs/tmp/*' }, - { :cmd => '/usr/bin/lxc-shutdown', :args => '--name *' }, - { :cmd => '/usr/bin/lxc-stop', :args => '--name *' }, - { :cmd => '/usr/bin/lxc-destroy', :args => '--name *' } + { cmd: '/usr/bin/lxc-ls', args: '' }, + { cmd: '/usr/bin/lxc-info', args: '' }, + { cmd: '/usr/bin/lxc-attach', args: '' }, + { cmd: '/usr/bin/which', args: 'lxc-*' }, + { cmd: '/bin/cat', args: '/var/lib/lxc/*' }, + { cmd: '/bin/mkdir', args: '/var/lib/lxc/*' }, + { cmd: '/bin/su', args: "root -c sed -e '*' -ibak /var/lib/lxc/*" }, + { cmd: '/bin/su', args: "root -c echo '*' >> /var/lib/lxc/*" }, + { cmd: '/usr/bin/lxc-start', args: '-d --name *' }, + { cmd: '/bin/cp', args: '%{BOXES}/*/lxc/lxc-template /usr/lib/lxc/templates/*' }, + { cmd: '/bin/cp', args: '%{BOXES}/*/lxc/lxc-template /usr/share/lxc/templates/*' }, + { cmd: '/bin/rm', args: '/usr/lib/lxc/templates/*' }, + { cmd: '/bin/rm', args: '/usr/share/lxc/templates/*' }, + { cmd: '/bin/chmod', args: '+x /usr/lib/lxc/*' }, + { cmd: '/bin/chmod', args: '+x /usr/share/lxc/*' }, + { cmd: '/usr/bin/lxc-create', args: '--template * --name * -- --tarball ${BOXES}/*' }, + { cmd: '/bin/rm', args: '-rf /var/lib/lxc/*/rootfs/tmp/*' }, + { cmd: '/usr/bin/lxc-shutdown', args: '--name *' }, + { cmd: '/usr/bin/lxc-stop', args: '--name *' }, + { cmd: '/usr/bin/lxc-destroy', args: '--name *' } ] end end