Skip to content

Commit

Permalink
multi-wwn support (intended for targets), increase of zone member num…
Browse files Browse the repository at this point in the history
…bers
  • Loading branch information
Florian Heigl, ([email protected]) committed May 25, 2020
1 parent 6804c7f commit bcf51b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions example/zonedata.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"ALIAS": [
{"SRV_P0":"00:00:00:00:00:00:00:01"},
{"SRV_P1":"00:00:00:00:00:00:00:02"},
{"CLI_PA":"00:00:00:00:00:00:00:03"},
{"CLI_PB":"00:00:00:00:00:00:00:04"}
{"SRV_P0":["00:00:00:00:00:00:00:01"]},
{"SRV_P1":["00:00:00:00:00:00:00:02"]},
{"CLI_PA":["00:00:00:00:00:00:00:03"]},
{"CLI_PB":["00:00:00:00:00:00:00:04"]},
{"STOR2" :["00:00:00:00:00:01:00:05","00:00:00:00:00:02:00:05"]}
],
"ZONES": [
{"SRV_CLI1":["SRV_P0","CLI_PA"]},
{"SRV_CLI2":["SRV_P1","CLI_PB"]}
{"SRV_CLI2":["SRV_P1","CLI_PB"]},
{"SRV_P0_STOR2":["SRV_P0","STOR2"]},
{"SRV_P1_STOR2":["SRV_P1","STOR2"]}
],
"CFGS": {
"FABRIC_1":["SRV_CLI1","SRV_CLI2"]
"FABRIC_1":["SRV_CLI1","SRV_CLI2","SRV_P0_STOR2","SRV_P1_STOR2" ]
}
}
4 changes: 2 additions & 2 deletions zoning.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def mkcfg(wwns,zoning,cfgs):
for wwn in wwns:
k = wwn.keys()
v = wwn.values()
alias = "alicreate %s, %s" % (k[0],v[0])
alias = """alicreate %s, "%s" """ % (k[0],(";").join(v[0]))
txt = txt + alias + "\n"

for zone in zoning:
k = zone.keys()
v = zone.values()
zone = 'zonecreate %s, "%s; %s"' % (k[0],v[0][0],v[0][1])
zone = """zonecreate "%s", "%s" """ % (k[0],(";").join(v[0]))
txt = txt + zone + "\n"

i = 0
Expand Down

0 comments on commit bcf51b4

Please sign in to comment.