auser / poolparty

Run a self-healing, auto-scaled and monitored cloud simply, in the clouds, on nearly any hardware, such as EC2, eucalyptus and vmware
http://www.poolpartyrb.com
MIT License
371 stars 54 forks source link

cmd method appends a trailing ' to each line. #76

Open hedgehog opened 14 years ago

hedgehog commented 14 years ago
$ ruby --version       
ruby 1.8.7 (2009-12-24 patchlevel 248) [i686-linux]

Adding this command string (NOTE: there is a trailing space on each line) to clouds.rb:

cmd_str=<<-EOT
echo deb http://apt.opscode.com/ debian contrib >/etc/apt/sources.list.d/opscode.list
curl http://apt.opscode.com/packages@opscode.com.gpg.key | apt-key add -
echo deb http://ppa.launchpad.net/alestic/ppa/ubuntu $(lsb_release -cs) main >/etc/apt/sources.list.d/alestic-ppa.list  
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BE09C571 
apt-get update 
apt-get install -y ec2-consistent-snapshot 
EOT
cmd cmd_str

Givesives this output on invoking cloud-configure

result for i-731c8b18 ==> n.ssh("echo deb http://apt.opscode.com/ debian contrib >/etc/apt/sources.list.d/opscode.list \ncurl http://apt.opscode.com/packages@opscode.com.gpg.key | apt-key add - \necho deb http://ppa.launchpad.net/alestic/ppa/ubuntu $(lsb_release -cs) main >/etc/apt/sources.list.d/alestic-ppa.list \napt-key adv --keyserver keyserver.ubuntu.com --recv-keys BE09C571 \napt-get update \napt-get install -y ec2-consistent-snapshot \n", {})                           
OK                                                                                              
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                 
                Dload  Upload   Total   Spent    Left  Speed                   
105  1690  105  1690    0     0    99k      0 --:--:-- --:--:-- --:--:-- 1650k                  
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --keyserver keyserver.ubuntu.com --recv-keys BE09C571 '                                                        
'                                                                                               
gpg: "'" not a key ID: skipping                                                                 
gpg: "'" not a key ID: skipping                                                                 
gpg: requesting key BE09C571 from hkp server keyserver.ubuntu.com                               
gpg: key BE09C571: "Launchpad PPA for Alestic" not changed                                      
gpg: Total number processed: 1                                                                  
gpg:              unchanged: 1                                                                  
E: The update command takes no arguments                                                        
E: Type ''' is not known on line 2 in source list /etc/apt/sources.list.d/alestic-ppa.list      
E: The list of sources could not be read.