Hi
I just started with python, and trying to implement some system admin tasks and running into some rough.
Basically I need to do some task on whichever share exists on their corresponding server.
eg
Server A has shares 1,2 and 3
Server B has share 1 and so on.
Any help is appreciated :)
pseudocode
while not Done:
Prompt for IP
while not Flag
prompt for shares
def get_config():
config_list = []
done = False
deny = 'n'
counter = 1
while not done:
print " Type n or N to exit "
ip = raw_input("Enter IP: ")
print "you entered ", ip
if ip.lower() == deny.lower():
done = True
flag = True
else:
config_list.append(ip)
flag = False
while not flag:
share = raw_input("Enter Shares : ")
if share.lower() == deny.lower():
flag = True
else:
config_list.append(share)
print "Config File Reads ", config_list
This works & after entering the values,I get an array like
[ 192.168.0.12 , Share1, Share2, 192.168.0.22, Share 1, 192.168.0.14, Share5, Share6, Share9 ]
Now for each IP, I need to do some action the shares on that server.
as in
for ip 192.168.0.12,
do task a on Share1,Share2
for ip 192.168.0.22,
do task a on Share1
and so on.....
I'm struggling how to implement the above. Any thoughts?