/[marcuscom]/meraki/setup_meraki_nets.py
ViewVC logotype

Diff of /meraki/setup_meraki_nets.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 20554 by jclarke, Thu May 10 22:38:14 2018 UTC revision 20556 by jclarke, Thu May 17 16:40:57 2018 UTC
# Line 98  def main(): Line 98  def main():
98                  break                  break
99    
100          if net_obj is None:          if net_obj is None:
101                nargs = {
102                    'timezone': net[nname]['timezone']
103                }
104                if 'copy_from_network' in net[nname]:
105                    for n in nets:
106                        if n.get('name') == net[nname]['copy_from_network']:
107                            nargs['copy_from_network_id'] = n.get('id')
108                            break
109              net_obj = org.create_network(              net_obj = org.create_network(
110                  nname, timezone=net[nname]['timezone'])                  nname, **nargs)
111    
112          if net_obj is None:          if net_obj is None:
113              print('Error creating new network {}!'.format(nname))              print('Error creating new network {}!'.format(nname))
# Line 168  def main(): Line 176  def main():
176                      nerrors += 1                      nerrors += 1
177    
178          if 'vlans' in net[nname]:          if 'vlans' in net[nname]:
             print('\n')  
179              # Ugh.  There is no API to enable VLANs yet.  So it's best to              # Ugh.  There is no API to enable VLANs yet.  So it's best to
180              # make this a manual step.  We could interact over the web, but              # make this a manual step.  We could interact over the web, but
181              # then we'd need to ask for a real user's credentials.              # then we'd need to ask for a real user's credentials.
182              #              #
183              # TODO Add support for copying from an existing network.              # If we copied from an existing network, then we assume that
184              raw_input(              # network has VLANs enabled.  If not, this will fail.
185                  '!!! Enable VLANs for network "{}" manually in the dashboard (under Security appliance > Addressing & VLANs), then hit enter to proceed !!!'.format(nname))              #
186              print('')              if 'copy_from_network' not in net[nname]:
187                    print('\n')
188                    raw_input(
189                        '!!! Enable VLANs for network "{}" manually in the dashboard (under Security appliance > Addressing & VLANs), then hit enter to proceed !!!'.format(nname))
190                    print('')
191              for vlan in net[nname]['vlans']:              for vlan in net[nname]['vlans']:
192                  vname = vlan.keys()[0]                  vname = vlan.keys()[0]
193                  if int(vlan[vname]['id']) != 1:                  if int(vlan[vname]['id']) != 1:

Legend:
Removed from v.20554  
changed lines
  Added in v.20556

  ViewVC Help
Powered by ViewVC 1.1.27