]> gitweb.fluxo.info Git - leap/leap_cli.git/commitdiff
remove sudo calls
authorelijah <elijah@riseup.net>
Sun, 4 Nov 2012 09:20:32 +0000 (01:20 -0800)
committerelijah <elijah@riseup.net>
Sun, 4 Nov 2012 09:20:32 +0000 (01:20 -0800)
lib/leap_cli/remote/tasks.rb
vendor/supply_drop/lib/supply_drop/plugin.rb

index 1b15f6b9d0ed13545b23cf21e3441c5ba9d23de6..9e89dbaa3162de637129da5007843fc05d052da0 100644 (file)
@@ -14,8 +14,8 @@ end
 
 task :install_prerequisites, :max_hosts => MAX_HOSTS do
   run "mkdir -p #{puppet_destination}"
-  run "#{sudo} apt-get update"
-  run "#{sudo} apt-get install -y puppet ruby-hiera-puppet rsync"
+  run "apt-get update"
+  run "apt-get install -y puppet ruby-hiera-puppet rsync"
 end
 
 #task :update_platform, :max_hosts => MAX_HOSTS do
index 348b22b53cade3d27f3bac31d73ba49bd280d34e..1784d59db3c9a4d8059302c3b5e6fe9acd4e9b32 100644 (file)
@@ -20,8 +20,8 @@ module SupplyDrop
     end
 
     def prepare
-      run "mkdir -p #{puppet_destination}"
-      run "#{sudo} chown -R $USER: #{puppet_destination}"
+      #run "mkdir -p #{puppet_destination}"
+      #run "#{sudo} chown -R $USER: #{puppet_destination}"
     end
 
     def noop
@@ -34,7 +34,7 @@ module SupplyDrop
 
     def lock
       if should_lock?
-        run <<-GETLOCK
+        cmd = <<-GETLOCK
 if [ ! -f #{puppet_lock_file} ]; then
     touch #{puppet_lock_file};
 else
@@ -42,11 +42,12 @@ else
     exit 1;
 fi
         GETLOCK
+        run cmd.gsub(/\s+/, ' ')
       end
     end
 
     def unlock
-      run "#{sudo} rm -f #{puppet_lock_file}; true" if should_lock?
+      run "rm -f #{puppet_lock_file}; true" if should_lock?
     end
 
     private