Fix "E: Unable to locate package -y"
authorArnout Boks <arnoutboks@gmail.com>
Mon, 5 Mar 2018 11:55:45 +0000 (12:55 +0100)
committerGitHub <noreply@github.com>
Mon, 5 Mar 2018 11:55:45 +0000 (12:55 +0100)
Due to the extra space, apt complained with "Unable to locate package  -y". Without the extra space, the task runs fine.

tasks/init.rb

index d256468b64a739fdaa6446f49b1d5069bc46891d..ebcf72adddee590f91516a756b07aadeccb16857 100755 (executable)
@@ -5,7 +5,7 @@ require 'puppet'
 
 def apt_get(action)
   cmd = ['apt-get', action]
-  cmd << ' -y' if action == 'upgrade'
+  cmd << '-y' if action == 'upgrade'
   stdout, stderr, status = Open3.capture3(*cmd)
   raise Puppet::Error, stderr if status != 0
   { status: stdout.strip }