def def_zone_reset(fid1, fid2): si = anturlar.SwitchInfo() sleep = liabhar.count_down(3) g = [fid1, fid2] for i in g: anturlar.fos_cmd("setcontext %s" % i) a = str(si.ae_ports()) b = a.strip('[') b = b.strip(']') index = (b[0]) port = (b[1]) reg_ex = [b"no] "] ### Needs to be square brackets to send as a list z = anturlar.fos_cmd_regex("defzone --allaccess", reg_ex, 9) #### use regex because return is something other than "root:" anturlar.fos_cmd("yes") sleep y = anturlar.fos_cmd_regex("cfgsave", reg_ex, 9) anturlar.fos_cmd("yes") sleep for i in port: anturlar.fos_cmd(" portdisable %s" % port) sleep anturlar.fos_cmd(" portenable %s" % port) sleep anturlar.fos_cmd("switchshow") sys.exit()
def def_zone_reset(fid1, fid2): si = anturlar.SwitchInfo() sleep = liabhar.count_down(3) g = [fid1, fid2] for i in g: anturlar.fos_cmd("setcontext %s" % i) a = str(si.ae_ports()) b = a.strip('[') b = b.strip(']') index = (b[0]) port = (b[1]) reg_ex = [b"no] "] ### Needs to be square brackets to send as a list z = anturlar.fos_cmd_regex( "defzone --allaccess", reg_ex, 9) #### use regex because return is something other than "root:" anturlar.fos_cmd("yes") sleep y = anturlar.fos_cmd_regex("cfgsave", reg_ex, 9) anturlar.fos_cmd("yes") sleep for i in port: anturlar.fos_cmd(" portdisable %s" % port) sleep anturlar.fos_cmd(" portenable %s" % port) sleep anturlar.fos_cmd("switchshow") sys.exit()
def start_windows_pre_3_2(h, start_cmd): db_level = 9 remote_list = [] start_pain = start_cmd cmdout = anturlar.traff_cmd("catapult -p") ras = re.compile('[ \d]+/dev/sd([a-z]+)\s+[:0-9]+\s+[A-Z]+\s+([A-Z]+)') remove_lunz = ras.findall(cmdout) for i in [1,2,3,4]: cmdout = anturlar.traff_cmd("bcu port --statsclr %s/0" % i, db_level) cmdout = anturlar.traff_cmd("bcu rport --osname %s/0" % i , db_level ) ras = re.compile('rive([0-9]+)') ras = ras.findall(cmdout) print("ras"*30) print(ras) print(remove_lunz) print(remote_list) print("ras"*30) for r in ras: remote_list += [r] cmdout = anturlar.traff_cmd("bcu port --statsclr %s/1" % i, db_level) cmdout = anturlar.traff_cmd("bcu rport --osname %s/1" % i , db_level ) ras = re.compile('rive([0-9]+)') ras = ras.findall(cmdout) for r in ras: remote_list += [r] print("remote port list : %s " % remote_list ) print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") #### put the list is the correct syntax new_list = ",".join(remote_list) print("NEW LIST IS : %s " % new_list) #### combine the command with the drive list start_pain_sd = start_pain + ' -f"\\\.\PhysicalDrive;%s"' % new_list print("NEWEST COMMAND %s " % start_pain_sd) reg_list = [b'([\w\d]+)'] cmdout = anturlar.fos_cmd_regex(start_pain_sd , reg_list) cmdout = anturlar.traff_output() anturlar.close_tel()
def start_windows_pre_3_2(h, start_cmd): db_level = 9 remote_list = [] start_pain = start_cmd cmdout = anturlar.traff_cmd("catapult -p") ras = re.compile('[ \d]+/dev/sd([a-z]+)\s+[:0-9]+\s+[A-Z]+\s+([A-Z]+)') remove_lunz = ras.findall(cmdout) for i in [1, 2, 3, 4]: cmdout = anturlar.traff_cmd("bcu port --statsclr %s/0" % i, db_level) cmdout = anturlar.traff_cmd("bcu rport --osname %s/0" % i, db_level) ras = re.compile('rive([0-9]+)') ras = ras.findall(cmdout) print("ras" * 30) print(ras) print(remove_lunz) print(remote_list) print("ras" * 30) for r in ras: remote_list += [r] cmdout = anturlar.traff_cmd("bcu port --statsclr %s/1" % i, db_level) cmdout = anturlar.traff_cmd("bcu rport --osname %s/1" % i, db_level) ras = re.compile('rive([0-9]+)') ras = ras.findall(cmdout) for r in ras: remote_list += [r] print("remote port list : %s " % remote_list) print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") #### put the list is the correct syntax new_list = ",".join(remote_list) print("NEW LIST IS : %s " % new_list) #### combine the command with the drive list start_pain_sd = start_pain + ' -f"\\\.\PhysicalDrive;%s"' % new_list print("NEWEST COMMAND %s " % start_pain_sd) reg_list = [b'([\w\d]+)'] cmdout = anturlar.fos_cmd_regex(start_pain_sd, reg_list) cmdout = anturlar.traff_output() anturlar.close_tel()
def create_ls(number_of_ls): si = anturlar.SwitchInfo() #sleep = liabhar.count_down(10) a = number_of_ls print(a) print("9999999999999999999999999999999999999999999") reg_ex = [b"[y/n]?:"] for i in a: print(i) print(type(i)) #sys.exit() z = anturlar.fos_cmd_regex("lscfg --create %s" % i, reg_ex, 9) #### use regex because return is something other than "root:" anturlar.fos_cmd("y") anturlar.fos_cmd("lscfg --show") #sleep print("done")
def start_linux_pre_3_2(h, start_cmd): """ the command is passed into this procedure and the drive letters are added to the command if there are Clariion devices the LUNZ devices are skipped """ db_level = 9 remote_list = [] start_pain = start_cmd ################################################################################################################### #### use catapult to capture the drives and and Volumn ID -- use this if they are Clariion to not add #### the drives with LUNZ Volumn ID since they are not target IDs #### cmdout = anturlar.traff_cmd("catapult -p") ras = re.compile('[ \d]+/dev/sd([a-z]+)\s+[:0-9]+\s+[A-Z]+\s+([A-Z]+)') remove_lunz = ras.findall(cmdout) for i in [4, 2, 3, 1]: cmdout = anturlar.traff_cmd("bcu port --statsclr %s/0" % i, db_level) cmdout = anturlar.traff_cmd("bcu rport --osname %s/0" % i, db_level) ras = re.compile('/dev/sd([a-z]+)') ras = ras.findall(cmdout) print("ras" * 30) print(ras) print(remove_lunz) print(remote_list) print("ras" * 30) for r in ras: for lunz in remove_lunz: print(r) print(lunz[0]) print(lunz[1]) if lunz[0] == r and lunz[1] != "LUNZ": if r not in remote_list: remote_list += [r] cmdout = anturlar.traff_cmd("bcu port --statsclr %s/1" % i, db_level) cmdout = anturlar.traff_cmd("bcu rport --osname %s/1" % i, db_level) ras = re.compile('/dev/sd([a-z]+)') ras = ras.findall(cmdout) for r in ras: for lunz in remove_lunz: if lunz[0] == r and lunz[1] != "LUNZ": if r not in remote_list: remote_list += [r] print("remote port list : %s " % remote_list) print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") #### put the list is the correct syntax by adding comma new_list = ",".join(remote_list) print("NEW LIST IS : %s " % new_list) print("#" * 80) #### combine the command with the drive list start_pain_sd = start_pain + ' -f"/dev/sd;%s"' % new_list print("NEWEST COMMAND %s " % start_pain_sd) reg_list = [b'([\w\d]+)'] cmdout = anturlar.fos_cmd_regex(start_pain_sd, reg_list, 9) cmdout = anturlar.traff_output(9) anturlar.close_tel()
def start_linux_post_3_2(h, start_cmd): db_level = 9 remote_list = [] start_pain = start_cmd ################################################################################################################### #### use catapult to capture the drives and and Volumn ID -- use this if they are Clariion to not add #### the drives with LUNZ Volumn ID since they are not target IDs #### cmdout = anturlar.traff_cmd("catapult -p") ras = re.compile('[ \d]+/dev/sd([a-z]+)\s+[:0-9]+\s+[A-Z]+\s+([A-Z]+)') remove_lunz = ras.findall(cmdout) for i in [1, 2, 3, 4]: cmdout = anturlar.traff_cmd("bcu port --statsclr %s/0" % i, db_level) cmdout = anturlar.traff_cmd("bcu fcpim --lunlist %s/0" % i, db_level) ras = re.compile('/dev/sd([a-z]+)') ras = ras.findall(cmdout) print("ras" * 30) print(ras) print(remove_lunz) print(remote_list) print("ras" * 30) for r in ras: for lunz in remove_lunz: print(r) print(lunz[0]) print(lunz[1]) if lunz[0] == r and lunz[1] != "LUNZ": if r not in remote_list: remote_list += [r] cmdout = anturlar.traff_cmd("bcu port --statsclr %s/1" % i, db_level) cmdout = anturlar.traff_cmd("bcu fcpim --lunlist %s/1" % i, db_level) ras = re.compile('/dev/sd([a-z]+)') ras = ras.findall(cmdout) remote_list = remote_list + ras for r in ras: for lunz in remove_lunz: if lunz[0] == r and lunz[1] != "LUNZ": if r not in remote_list: remote_list += [r] print("remote port list : %s " % remote_list) print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") #### put the list is the correct syntax new_list = ",".join(remote_list) print("NEW LIST IS : %s " % new_list) #### combine the command with the drive list start_pain_sd = start_pain + ' -f"/dev/sd;%s"' % new_list print("NEWEST COMMAND %s " % start_pain_sd) reg_list = [b'([\w\d]+)'] cmdout = anturlar.fos_cmd_regex(start_pain_sd, reg_list) cmdout = anturlar.traff_output() anturlar.close_tel()
def start_linux_pre_3_2(h, start_cmd): """ the command is passed into this procedure and the drive letters are added to the command if there are Clariion devices the LUNZ devices are skipped """ db_level = 9 remote_list = [] start_pain = start_cmd ################################################################################################################### #### use catapult to capture the drives and and Volumn ID -- use this if they are Clariion to not add #### the drives with LUNZ Volumn ID since they are not target IDs #### cmdout = anturlar.traff_cmd("catapult -p") ras = re.compile('[ \d]+/dev/sd([a-z]+)\s+[:0-9]+\s+[A-Z]+\s+([A-Z]+)') remove_lunz = ras.findall(cmdout) for i in [4,2,3,1]: cmdout = anturlar.traff_cmd("bcu port --statsclr %s/0" % i, db_level) cmdout = anturlar.traff_cmd("bcu rport --osname %s/0" % i , db_level ) ras = re.compile('/dev/sd([a-z]+)') ras = ras.findall(cmdout) print("ras"*30) print(ras) print(remove_lunz) print(remote_list) print("ras"*30) for r in ras: for lunz in remove_lunz: print(r) print(lunz[0]) print(lunz[1]) if lunz[0] == r and lunz[1] != "LUNZ": if r not in remote_list: remote_list += [r] cmdout = anturlar.traff_cmd("bcu port --statsclr %s/1" % i, db_level) cmdout = anturlar.traff_cmd("bcu rport --osname %s/1" % i , db_level ) ras = re.compile('/dev/sd([a-z]+)') ras = ras.findall(cmdout) for r in ras: for lunz in remove_lunz: if lunz[0] == r and lunz[1] != "LUNZ": if r not in remote_list: remote_list += [r] print("remote port list : %s " % remote_list ) print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") #### put the list is the correct syntax by adding comma new_list = ",".join(remote_list) print("NEW LIST IS : %s " % new_list) print("#"*80) #### combine the command with the drive list start_pain_sd = start_pain + ' -f"/dev/sd;%s"' % new_list print("NEWEST COMMAND %s " % start_pain_sd) reg_list = [b'([\w\d]+)'] cmdout = anturlar.fos_cmd_regex(start_pain_sd , reg_list,9) cmdout = anturlar.traff_output(9) anturlar.close_tel()
def start_linux_post_3_2(h, start_cmd): db_level = 9 remote_list = [] start_pain = start_cmd ################################################################################################################### #### use catapult to capture the drives and and Volumn ID -- use this if they are Clariion to not add #### the drives with LUNZ Volumn ID since they are not target IDs #### cmdout = anturlar.traff_cmd("catapult -p") ras = re.compile('[ \d]+/dev/sd([a-z]+)\s+[:0-9]+\s+[A-Z]+\s+([A-Z]+)') remove_lunz = ras.findall(cmdout) for i in [1,2,3,4]: cmdout = anturlar.traff_cmd("bcu port --statsclr %s/0" % i, db_level) cmdout = anturlar.traff_cmd("bcu fcpim --lunlist %s/0" % i , db_level ) ras = re.compile('/dev/sd([a-z]+)') ras = ras.findall(cmdout) print("ras"*30) print(ras) print(remove_lunz) print(remote_list) print("ras"*30) for r in ras: for lunz in remove_lunz: print(r) print(lunz[0]) print(lunz[1]) if lunz[0] == r and lunz[1] != "LUNZ": if r not in remote_list: remote_list += [r] cmdout = anturlar.traff_cmd("bcu port --statsclr %s/1" % i, db_level) cmdout = anturlar.traff_cmd("bcu fcpim --lunlist %s/1" % i , db_level ) ras = re.compile('/dev/sd([a-z]+)') ras = ras.findall(cmdout) remote_list = remote_list + ras for r in ras: for lunz in remove_lunz: if lunz[0] == r and lunz[1] != "LUNZ": if r not in remote_list: remote_list += [r] print("remote port list : %s " % remote_list ) print("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") #### put the list is the correct syntax new_list = ",".join(remote_list) print("NEW LIST IS : %s " % new_list) #### combine the command with the drive list start_pain_sd = start_pain + ' -f"/dev/sd;%s"' % new_list print("NEWEST COMMAND %s " % start_pain_sd) reg_list = [b'([\w\d]+)'] cmdout = anturlar.fos_cmd_regex(start_pain_sd , reg_list) cmdout = anturlar.traff_output() anturlar.close_tel()