lib/fabric/account.rb in fabric-0.4.1 vs lib/fabric/account.rb in fabric-0.4.2
- old
+ new
@@ -21,12 +21,10 @@
self.server.execute_command("echo '#{self.user.authorized_keys_file}' | sudo tee #{self.user.authorized_keys_file_path}")
self.set_ssh_key_permissions
end
def add_to_groups
- self.user.groups.each do |group|
- self.server.execute_command("sudo /usr/sbin/usermod -G#{group.name} #{self.user.name}")
- end
+ self.server.execute_command("sudo /usr/sbin/usermod -a -G #{self.user.groups.collect(&:name).join(',')} #{self.user.name}")
end
protected
def set_ssh_key_permissions
self.server.execute_command("sudo chown #{self.user.name} #{self.user.authorized_keys_file_path}")
\ No newline at end of file