Using fabric if I echo to sudoers file for second time the file got corrupted works fine for first echo. What could be the reason?
sudo('echo "django ALL=(ALL:ALL) ALL" | sudo tee -a /etc/sudoers')
sudo('echo "celery ALL(www-data) NOPASSWD: /usr/bin/unoconv" | sudo tee -a /etc/sudoers')
After second echo command and when trying to do sudo I am getting parse error and I am not able to recover the sudoers file again, I have to create a new instance unfortunately:
>>> /etc/sudoers: syntax error near line 28 <<< sudo: parse error in /etc/sudoers near line 28 sudo: no valid sudoers sources found, quitting
There is no syntax issue as such in second command because if I type it manually using
visudo it works fine. And I don't think that its fabric related issue. Fabric is just executing commands on the remote server.