Skip to content

Commit 0b736e4

Browse files
committed
PEP8 changes
1 parent 51e05f8 commit 0b736e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ping_servers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@
4747

4848
filename = sys.argv[0] # Sets a variable for the script name
4949
logdir = os.getenv("logs") # Set the variable logdir by getting the OS environment logs
50-
logfile = 'ping_'+appgroup+'_'+site+'.log' # Set the variable logfile, using the arguments passed to create the logfile
51-
logfilename=os.path.join(logdir, logfile) # Set the variable logfilename by joining logdir and logfile together
50+
logfile = 'ping_' + appgroup + '_' + site + '.log' # Set the variable logfile, using the arguments passed to create the logfile
51+
logfilename = os.path.join(logdir, logfile) # Set the variable logfilename by joining logdir and logfile together
5252
confdir = os.getenv("my_config") # Set the variable confdir from the OS environment variable - 1.2
53-
conffile = (appgroup+'_servers_'+site+'.txt') # Set the variable conffile - 1.2
54-
conffilename=os.path.join(confdir, conffile) # Set the variable conffilename by joining confdir and conffile together - 1.2
53+
conffile = (appgroup + '_servers_' + site + '.txt') # Set the variable conffile - 1.2
54+
conffilename = os.path.join(confdir, conffile) # Set the variable conffilename by joining confdir and conffile together - 1.2
5555

5656
f = open(logfilename, "w") # Open a logfile to write out the output
5757
for server in open(conffilename): # Open the config file and read each line - 1.2
58-
ret = subprocess.call(myping + server, shell=True,stdout=f,stderr=subprocess.STDOUT) # Run the ping command for each server in the list.
58+
ret = subprocess.call(myping + server, shell=True, stdout=f, stderr=subprocess.STDOUT) # Run the ping command for each server in the list.
5959
if ret == 0: # Depending on the response
6060
f.write (server.strip() + " is alive" + "\n") # Write out that you can receive a reponse
6161
else:
6262
f.write (server.strip() + " did not respond" + "\n") # Write out you can't reach the box
6363

64-
print ("\n\tYou can see the results in the logfile : "+ logfilename); # Show the location of the logfile
64+
print ("\n\tYou can see the results in the logfile : " + logfilename); # Show the location of the logfile

0 commit comments

Comments
 (0)