diff --git a/tsshbatch.py b/tsshbatch.py index bdf93fc..815c720 100755 --- a/tsshbatch.py +++ b/tsshbatch.py @@ -20,7 +20,7 @@ CMDINCL = PROGENV + "CMDS" HOSTINCL = PROGENV + "HOSTS" -CVSID = "$Id: tsshbatch.py,v 1.169 2013/10/29 14:35:03 tundra Exp $" +CVSID = "$Id: tsshbatch.py,v 1.170 2013/10/29 15:02:50 tundra Exp $" VERSION = CVSID.split()[2] CPRT = "(c)" DATE = "2011-2013" @@ -456,7 +456,7 @@ fname = ConditionLine(line.split(INCLUDE)[1]) ReadFile(fname, envvar, listcontainer, containingfile=filename) - # It's an ordinary line - do variable substitution and save + # It's a normal line - do variable substitution and save else: listcontainer.append(VarSub(line)) f.close() @@ -517,6 +517,7 @@ # End of 'VarSub()' + # ---------------------- Program Entry Point ---------------------- # ##### @@ -615,7 +616,9 @@ # are understood to form the command. else: + # First, do variable substitution on passed hosts + for index in range(len(Hosts)): Hosts[index] = VarSub(Hosts[index]) @@ -623,7 +626,9 @@ command = " ".join(args[0:]) -# Put command in a list data structure because this is what the + + +# Put it in a list data structure because this is what the # HostCommands() function expects. This is necessary to handle multi # command input from from a file. @@ -660,12 +665,12 @@ current_user = UNAME UNAME = raw_input(pUSER %current_user) if not UNAME: # User just hit return - wants default - Uname = Current_User + UNAME = current_user - # Preset Commandline And/Or Program Option Variable Password Takes Precedence + # Preset commandline and/or program option variable password takes precedence - If Not Pword: - Pword = Getpass.getpass(pPASS) + if not PWORD: + PWORD = getpass.getpass(pPASS) ##### # If Needed, Get sudo Password