#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Sudo fabric commands.

:copyright: (c) 2014 by Alexander Skiba <skiba@icg.tugraz.at>
:licence: MIT
:bugreports: skiba@icg.tugraz.at

"""

import configuration as config
from fabric.api import task
from fabric.contrib.files import append
from os.path import splitext, basename

# module configuration ########################################################


MODULE = splitext(basename(__file__))[0]
CONFIGURATION = config.get_configuration(MODULE)


# tasks: need configuration ###################################################

if CONFIGURATION is not None:
    @task
    def allow_passwordless_sudo(username):
        """(SUDO) Enable a user to use sudo without password."""

        sudo_string = "{} ALL=(ALL) NOPASSWD: ALL\n".format(username)
        append("/etc/sudoers", sudo_string, use_sudo=True)

@@ -506,29 +506,29 @@
 asks
-: need configuration 
+ ####################
 ####
@@ -580,52 +580,14 @@
 ##%0A%0A
-if CONFIGURATION is not None:%0A    
 @task%0A
-    
 def 
@@ -625,20 +625,16 @@
 e):%0A    
- 
-   
 %22%22%22(SUDO
@@ -687,20 +687,16 @@
 %22%22%0A%0A    
-   
- 
 sudo_str
@@ -749,20 +749,16 @@
 ername)%0A
-    
     appe

fix command not shown