Issue #1835 has been updated by mfournier.

I just gave it a try. The quoting stuff looks fine but I think a regression got 
introduced by this change. Augeas now silently fails to write the changes to 
the file, even without any quoted strings. But maybe I'm doing something wrong. 
Can you confirm ?

<pre>
m...@lonquimay:~/src/puppet$ cat /etc/samba/smb.conf
[global]
  foo = bar

[printers]
  youpla = boum

m...@lonquimay:~/src/puppet$ cat /tmp/test.pp
augeas { "testX":
  context => "/files/etc/samba/smb.conf/target[1]/",
  changes => "set foobar blabla",
}
augeas { "testY":
  context => "/files/etc/samba/smb.conf/target[1]/",
  changes => "set foo sdfgsdfg",
}

m...@lonquimay:~/src/puppet$ git checkout bkearney/1835
Previous HEAD position was 8befc18... Updated to version 0.24.7
HEAD is now at 8bfa29f... Fix #1835 : Add whitespace/quote parsing to

m...@lonquimay:~/src/puppet$  RUBYLIB=lib/ bin/puppet /tmp/test.pp 
notice: //Augeas[testX]/returns: executed successfully
notice: //Augeas[testY]/returns: executed successfully
m...@lonquimay:~/src/puppet$ cat /etc/samba/smb.conf
[global]
  foo = bar

[printers]
  youpla = boum

m...@lonquimay:~/src/puppet$ git checkout 0.24.7
Previous HEAD position was 8bfa29f... Fix #1835 : Add whitespace/quote parsing 
to
HEAD is now at 8befc18... Updated to version 0.24.7

m...@lonquimay:~/src/puppet$  RUBYLIB=lib/ bin/puppet /tmp/test.pp 
notice: //Augeas[testY]/returns: executed successfully
notice: //Augeas[testX]/returns: executed successfully
m...@lonquimay:~/src/puppet$ cat /etc/samba/smb.conf
[global]
  foo = sdfgsdfg

   foobar = blabla
[printers]
  youpla = boum

</pre>
----------------------------------------
Bug #1835: augeas fails when arguments contain whitespaces
http://projects.reductivelabs.com/issues/show/1835

Author: mfournier
Status: Ready for Testing
Priority: Normal
Assigned to: [email protected]
Category: 
Target version: 
Complexity: Unknown
Affected version: 0.24.7
Keywords: augeas quote whitespace argument


Augeas needs to have arguments containing whitespaces to be quoted:
<pre>
augtool> get /files/etc/samba/smb.conf/target[1]/unix password sync
Too many arguments for get
augtool> get /files/etc/samba/smb.conf/target[1]/unix\ password\ sync
Too many arguments for get
augtool> get "/files/etc/samba/smb.conf/target[1]/unix password sync"
/files/etc/samba/smb.conf/target[1]/unix password sync = yes
</pre>

It seems the puppet augeas type doesn't handle the quoting/whitespace stuff:
<pre>
m...@lonquimay:~/src/puppet$ cat /tmp/test.pp 
augeas { "test1":
  context => "/files/etc/samba/smb.conf/target[1]/",
  changes => "set pam password change no",
}
augeas { "test2":
  context => "/files/etc/samba/smb.conf/target[1]/",
  changes => "set \"unix password sync\" no",
}
augeas { "test3":
  context => "/files/etc/samba/smb.conf/target[1]/",
  changes => "set 'server string' foobar",
}
m...@lonquimay:~/src/puppet$ bin/puppet --debug /tmp/test.pp 
debug: Creating default schedules
debug: //Augeas[test3]: Changing returns
debug: //Augeas[test3]: 1 change(s)
debug: Augeas[test3](provider=augeas): Opening augeas with root /, lens path , 
flags 0
debug: Augeas[test3](provider=augeas): sending command 'set' with params 
["/files/etc/samba/smb.conf/target[1]/'server", "string' foobar"]
err: //Augeas[test3]/returns: change from need_to_run to 0 failed: Save failed 
with return code false
debug: //Augeas[test1]: Changing returns
debug: //Augeas[test1]: 1 change(s)
debug: Augeas[test1](provider=augeas): Opening augeas with root /, lens path , 
flags 0
debug: Augeas[test1](provider=augeas): sending command 'set' with params 
["/files/etc/samba/smb.conf/target[1]/pam", "password change no"]
err: //Augeas[test1]/returns: change from need_to_run to 0 failed: Save failed 
with return code false
debug: //Augeas[test2]: Changing returns
debug: //Augeas[test2]: 1 change(s)
debug: Augeas[test2](provider=augeas): Opening augeas with root /, lens path , 
flags 0
debug: Augeas[test2](provider=augeas): sending command 'set' with params 
["/files/etc/samba/smb.conf/target[1]/\"unix", "password sync\" no"]
err: //Augeas[test2]/returns: change from need_to_run to 0 failed: Save failed 
with return code false
debug: Finishing transaction 69963456452840 with 3 changes
</pre>



----------------------------------------
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to