Even in a good, from the point of view of design, the network from time to time it is necessary to carry out work on updating configurations of certain entities. Among the most compelling and expected reasons for such activity are migration to reconcile the physical and logical planes, the development of the network as part of the process of technological evolution, the harmonization of architectures of the merged segments and the solution of growth problems. In fact, the life cycle of the network almost always represents a change with a certain level of risk and the impact on the service, in the assessment of which the human factor cannot be ignored. Although it would be entirely appropriate to generalize this description to most areas of human activity, the functioning of communication networks has some features that deserve understanding, or at least attention, - elements of communication networks are closely connected, closely interacting and have not only direct, but also indirect impact on each other. Therefore, a competent strategy of the work to be carried out will only be more productive if supported by mechanisms that reduce, as far as possible, the probability of human errors. In the next article of the cycle
“Why Networking Engineers Programming”, I will talk about the options for using automation in one task of this kind.
In many "primers" in network architecture, the terms large-scale networks and hierarchical networks are used almost synonymously, with reference to the design of an IGP domain, a simple and seemingly comprehensible design is indicated - splitting a domain into domains. At the same time, the saturation threshold is a purely individual thing, in some cases, in a single IGP region, a thousand modern routers can coexist normally, otherwise, three hundred is enough to significantly reduce performance. For the most part, this threshold is superimposed on the IGP protocols; therefore, with some variation and uncertainty of the boundaries and scales of the future network, industry bison find it more flexible to build a flat domain and then migrate its formed parts to separate areas. In other words, if you cannot “look into tomorrow today,” build a flat network and split it up after the first signs of degradation of convergence time or excessive operating complexity appear, because the lack of hierarchy is still better than the wrong one in uncertainty. structure [1, 2, 3].
Quite general descriptions and abstract examples, suppose that we are dealing with an overgrown domain of the OSPFv2 domain, the topology of the physical fibers / channels of which already allows us to see the boundaries of future regions in an amorphous structure. I am not a supporter of changing something according to the principle “all or nothing”, it may happen that due to unforeseen circumstances the space of opportunities will become too narrow, and the expected risks are too great. Changing the OSPFv2 area is a destructive operation, so the most straightforward migration process scheme, which is to consistently transfer routers to a new area along the path from the future border down, is convenient far in all topologies. Fortunately, some time ago, the OSPF development guidelines indicated the possibility of building connectivity within several areas [4]. Taking this opportunity, we can split the migration into three stages:
- Building additional (secondary) connectivity in the new area
- Transfer of the new area to the main mode, and the old to the additional
- Removing connectivity within the old domain
At the first stage, the topology of the new area gradually expands, at the second, the topology of the old area is narrowed. By observing the congruence of the topologies of the old and the new areas, we will get coordinated routing between the translated and non-translated nodes, and this, in turn, makes it possible to divide the stages into independent sub-stages, each of which can work with some part of the nodes. It is advisable to approach the choice of nodes for work within the sub-stage from the point of view of actual utilization of channels in a particular network, so as to prevent a reboot at the border of the old and new areas. Despite the fact that the article is devoted to programming, I think it would not be superfluous to say a few words about the behavior of the protocols imposed on IGP in the context of changing areas. LDP behaves quite predictably, smoothness of translation is achieved by providing IP connectivity between the transport-address targeted and front-end sessions. Due to the fact that BGP is a very flexible protocol, you should pay close attention to this plane. It is good if on the translated nodes BGP does not introduce particular liberties in the choice of the path in the form of Local Preferences change that is inconsistent between the nodes or other criteria that cause local routing decision. In other words, the behavior of BGP is also predictable, if within the region the choice of route did not contradict the follow IGP path rule. There is a subtle point related to the work of RSVP in the period of time when two regions coexist. The ground for reflection throws up the fact that the TED is filled with tables from two sources with different visibility, for example, you may well lose FRR mechanisms until the work is complete. This can happen if routers with greater visibility, which are located in two areas, consider the ERO through a router with lower visibility, i.e. through the translated network segment without topological information about another area. This cannot be called a catastrophe, since the path will eventually be established in the end, but you should not forget about it. Special art requires combining work on the implementation of IGP hierarchies with works of the same kind in the BGP plane, for example, by migration of full-mesh to route reflectors. The implementation of hierarchies in different planes is best done consistently, the same, in my opinion, applies to all things that hide route information, summation is easier to build on a stable foundation of a hierarchical IGP, rather than combining these steps.
So, we have a general plan, and, if you have not changed your mind yet, let's think about the software implementation on Pyez, like the one in this figure.

Each beautiful oval can be a separate program entity, i.e. such a thing that does the work and prepares the data for the next stage. Source data means information from the network, for example, to prepare the configuration of a new OSPF area, you need to get the names of the active interfaces belonging to the old area and their weights, which means we can use the skills of working with Operation tables and views. These concepts can be found in the previous article in the
“Programming for Network Engineers: First Case” series . At the first stage, the generator saves to the command files necessary for the activation of the new area, at the second - to delete the old one and transfer the new one to the main mode, at the third - the commands to delete the old area. Looking ahead to say that for this article, I deliberately do not use template visualizers, like Jinja2. In order not to be distracted from the target topic, the code is written as simply as possible. If someone is interested in the documentation on the link
"Jinja2 Documentation" .
Stage configuration generation codeimport sys import yaml from jnpr.junos.factory.factory_loader import FactoryLoader from jnpr.junos import Device def getConnection(p_host, p_user): acc = {'lab': 'lab123'} try: print ' DEBUG --- getting ssh connection to ' + p_host l_dev = Device(host=p_host, user=p_user, password=acc[p_user], auto_probe=2, gather_facts=True, port=22) l_dev.open() if (l_dev.connected): l_dev.timeout = 900 print ' DEBUG --- ssh cionnection to host ' + p_host + ' established' print ' DEBUG --- connection ' + p_host + ' named ' + l_dev.facts['hostname'] + ' established ' return l_dev else: raise Exception(' DEBUG --- ssh connection to ' + p_host + ' was not established') except Exception as ex: print ' DEBUG --- ERROR --- getConnection : connection to ' + p_host + ' was not established. ex:' + str(ex) return def close_dev(d): try: d.close() except Exception as ex: print ' DEBUG --- ERROR --- close_dev : connection to cant be closed. ex:' + str(ex) yml = ''' --- OSPFInterface: rpc: get-ospf-interface-information args: area: '0.0.0.200' detail: True item: ospf-interface view: OSPFInterfaceView OSPFInterfaceView: fields: name: interface-name type: interface-type cost: interface-cost ''' globals().update(FactoryLoader().load(yaml.load(yml))) node_list = ['10.83.20.68', '10.83.20.69', '10.83.20.70', '10.83.20.71'] abr_list = ['10.83.20.66', '10.83.20.67'] for node in node_list + abr_list: ddev = getConnection(node, 'lab') ospf_interfaces = OSPFInterface(ddev).get() with open('st1-' + node + '.txt', "w") as f_st1: for ospf_interface in ospf_interfaces: if ( 'ge' in ospf_interface.name ): f_st1.write('set protocols ospf area 0.0.0.250 interface ' + ospf_interface.name + ' secondary' + '\n') f_st1.write('set protocols ospf area 0.0.0.250 interface ' + ospf_interface.name + ' interface-type p2p' + '\n') f_st1.write('set protocols ospf area 0.0.0.250 interface ' + ospf_interface.name + ' metric ' + ospf_interface.cost + '\n') with open('st2-' + node + '.txt', "w") as f_st1: f_st1.write('delete protocols ospf area 0.0.0.200' + '\n') f_st1.write('delete protocols ospf area 0.0.0.250' + '\n') for ospf_interface in ospf_interfaces: f_st1.write('set protocols ospf area 0.0.0.250 interface ' + ospf_interface.name + ' interface-type p2p' + '\n') f_st1.write('set protocols ospf area 0.0.0.200 interface ' + ospf_interface.name + ' secondary' + '\n') f_st1.write('set protocols ospf area 0.0.0.200 interface ' + ospf_interface.name + ' interface-type p2p' + '\n') if (ospf_interface.cost != '0'): f_st1.write('set protocols ospf area 0.0.0.250 interface ' + ospf_interface.name + ' metric ' + ospf_interface.cost + '\n') f_st1.write('set protocols ospf area 0.0.0.200 interface ' + ospf_interface.name + ' metric ' + ospf_interface.cost + '\n') with open('st3-' + node + '.txt', "w") as f_st1: f_st1.write('delete protocols ospf area 0.0.0.200' + '\n')
For clarity, I gathered in just such a network on vMX.

vMX is a full-fledged software router from Juniper Networks, largely repeating the behavior of its older, iron brother MX. It’s not that it was a product that needs to be presented, it’s just useful to keep such things handy for programming exercises or laboratory tests. Trial, you can download here
“vMX Trial Download” , and the installation instructions for this link are
“Preparing the System to Install vMX” .
Routers bb, abr1 and abr2 form the null area, routers r1, r2, r3 and r4 - should be moved from the 200th area to the 250th.
lab @ bb> show configuration protocols bgp { group int { type internal; local-address 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.67; neighbor 10.0.0.68; neighbor 10.0.0.69; neighbor 10.0.0.70; neighbor 10.0.0.71; } } ospf { area 0.0.0.0 { interface lo0.0 { passive; } interface ge-0/0/3.0 { interface-type p2p; } interface ge-0/0/2.0 { interface-type p2p; } } }
lab @ abr1> show configuration protocols bgp { group int { type internal; local-address 10.0.0.66; neighbor 10.0.0.65; neighbor 10.0.0.67; neighbor 10.0.0.68; neighbor 10.0.0.69; neighbor 10.0.0.70; neighbor 10.0.0.71; } } ospf { area 0.0.0.0 { interface lo0.0 { interface-type p2p; } interface ge-0/0/3.0 { interface-type p2p; } interface ge-0/0/0.0 { interface-type p2p; } } area 0.0.0.200 { interface ge-0/0/1.0 { interface-type p2p; } } }
lab @ abr2> show configuration protocols bgp { group int { type internal; local-address 10.0.0.67; neighbor 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.68; neighbor 10.0.0.69; neighbor 10.0.0.70; neighbor 10.0.0.71; } } ospf { area 0.0.0.0 { interface lo0.0 { interface-type p2p; } interface ge-0/0/0.0 { interface-type p2p; } interface ge-0/0/2.0 { interface-type p2p; } } area 0.0.0.200 { interface ge-0/0/1.0 { interface-type p2p; } } }
lab @ r1> show configuration protocols bgp { group int { type internal; local-address 10.0.0.68; neighbor 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.67; neighbor 10.0.0.69; neighbor 10.0.0.70; neighbor 10.0.0.71; } } ospf { area 0.0.0.200 { interface ge-0/0/1.0 { interface-type p2p; } interface ge-0/0/2.0 { interface-type p2p; } interface ge-0/0/3.0 { interface-type p2p; } interface lo0.0 { interface-type p2p; } } }
lab @ r2> show configuration protocols bgp { group int { type internal; local-address 10.0.0.69; neighbor 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.67; neighbor 10.0.0.68; neighbor 10.0.0.70; neighbor 10.0.0.71; } } ospf { area 0.0.0.200 { interface ge-0/0/0.0 { interface-type p2p; } interface ge-0/0/3.0 { interface-type p2p; } interface lo0.0 { interface-type p2p; } } }
lab @ r3> show configuration protocols bgp { group int { type internal; local-address 10.0.0.70; neighbor 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.67; neighbor 10.0.0.68; neighbor 10.0.0.69; neighbor 10.0.0.71; } } ospf { area 0.0.0.200 { interface ge-0/0/0.0 { interface-type p2p; } interface ge-0/0/3.0 { interface-type p2p; } interface lo0.0 { interface-type p2p; } } }
lab @ r4> show configuration protocols bgp { group int { type internal; local-address 10.0.0.71; neighbor 10.0.0.65; neighbor 10.0.0.66; neighbor 10.0.0.67; neighbor 10.0.0.68; neighbor 10.0.0.69; neighbor 10.0.0.70; } } ospf { area 0.0.0.200 { interface ge-0/0/1.0 { interface-type p2p; } interface ge-0/0/2.0 { interface-type p2p; } interface ge-0/0/3.0 { interface-type p2p; } interface lo0.0 { interface-type p2p; } } }
For r2, the next set of commands will be generated.
For the first stageset protocols ospf area 0.0.0.250 interface ge-0/0 / 1.0 secondary
set protocols ospf area 0.0.0.250 interface ge-0/0 / 1.0 interface-type p2p
set protocols ospf area 0.0.0.250 interface ge-0/0 / 1.0 metric 1
set protocols ospf area 0.0.0.250 interface ge-0/0 / 2.0 secondary
set protocols ospf area 0.0.0.250 interface ge-0/0 / 2.0 interface-type p2p
set protocols ospf area 0.0.0.250 interface ge-0/0 / 2.0 metric 1
set protocols ospf area 0.0.0.250 interface ge-0/0 / 3.0 secondary
set protocols ospf area 0.0.0.250 interface ge-0/0 / 3.0 interface-type p2p
set protocols ospf area 0.0.0.250 interface ge-0/0 / 3.0 metric 1
For the second stagedelete protocols ospf area 0.0.0.200
delete protocols ospf area 0.0.0.250
set protocols ospf area 0.0.0.250 interface ge-0/0 / 1.0 interface-type p2p
set protocols ospf area 0.0.0.200 interface ge-0/0 / 1.0 secondary
set protocols ospf area 0.0.0.200 interface ge-0/0 / 1.0 interface-type p2p
set protocols ospf area 0.0.0.250 interface ge-0/0 / 1.0 metric 1
set protocols ospf area 0.0.0.200 interface ge-0/0 / 1.0 metric 1
set protocols ospf area 0.0.0.250 interface ge-0/0 / 2.0 interface-type p2p
set protocols ospf area 0.0.0.200 interface ge-0/0 / 2.0 secondary
set protocols ospf area 0.0.0.200 interface ge-0/0 / 2.0 interface-type p2p
set protocols ospf area 0.0.0.250 interface ge-0/0 / 2.0 metric 1
set protocols ospf area 0.0.0.200 interface ge-0/0 / 2.0 metric 1
set protocols ospf area 0.0.0.250 interface ge-0/0 / 3.0 interface-type p2p
set protocols ospf area 0.0.0.200 interface ge-0/0 / 3.0 secondary
set protocols ospf area 0.0.0.200 interface ge-0/0 / 3.0 interface-type p2p
set protocols ospf area 0.0.0.250 interface ge-0/0 / 3.0 metric 1
set protocols ospf area 0.0.0.200 interface ge-0/0 / 3.0 metric 1
set protocols ospf area 0.0.0.250 interface lo0.0 interface-type p2p
set protocols ospf area 0.0.0.200 interface lo0.0 secondary
set protocols ospf area 0.0.0.200 interface lo0.0 interface-type p2p
For the third stagedelete protocols ospf area 0.0.0.200
As I wrote the network elements have an internal state, around and within them something constantly happens, whether we like it or not. The occurrence of such events as a failure of the transceiver, a power outage at the site, or an optical channel breakage should be taken for granted and taken into account during the work. I propose to draw attention to this fact in the context of the selection of checks on the success of the migration stages. No matter how paradoxical it may sound, in this case, it is not necessary for us to check whether the OSPF neighborhood appeared on a particular interface, since the reasons for its absence may be located in a completely different plane. In addition to the above, the source data can always get an error or inaccuracy, for example, for example, in the form of a forgotten interface, which is to be deleted, and is currently looking at the “void”. In the process of building checks, it is useful to rise to a higher level in order to look at the network from the point of view of the services provided and the protocols imposed, since ultimately the state of only these things allows you to make an informed decision about the success of a particular stage. Few customers agree to public articles on the results of the work performed, and therefore I have put together a virtual environment for the demonstration. Within the framework of this environment, I will limit myself to checking the state of BGP sessions, which are built according to each-with-each scheme between routers, this will be our superimposed services and services. If, after the work, the conditions for their performance in the form of IP connectivity with each-every-one are met, then there is also reason to believe that the work was carried out successfully. In real projects, verification is usually limited to the volume of services and overlay protocols, which are designated as business critical on a given network. This does not apply to programming, however, I cannot help but focus on this issue, since the choice of the criterion of success is the key to a restful sleep after the work done.
BGP session verification code import sys import yaml from jnpr.junos.factory.factory_loader import FactoryLoader from jnpr.junos import Device def getConnection(p_host, p_user): acc = {'lab': 'lab123'} try: print ' DEBUG --- getting ssh connection to ' + p_host l_dev = Device(host=p_host, user=p_user, password=acc[p_user], auto_probe=2, gather_facts=True, port=22) l_dev.open() if (l_dev.connected): l_dev.timeout = 900 print ' DEBUG --- ssh cionnection to host ' + p_host + ' established' print ' DEBUG --- connection ' + p_host + ' named ' + l_dev.facts['hostname'] + ' established ' return l_dev else: raise Exception(' DEBUG --- ssh connection to ' + p_host + ' was not established') except Exception as ex: print ' DEBUG --- ERROR --- getConnection : connection to ' + p_host + ' was not established. ex:' + str(ex) return def close_dev(d): try: d.close() except Exception as ex: print ' DEBUG --- ERROR --- close_dev : connection to cant be closed. ex:' + str(ex) ip_f_name = 'ip-list-1.txt' yml = ''' --- BGPGroup: rpc: get-bgp-group-information args: group-name: 'int' item: bgp-group view: BGPGroupView BGPGroupView: fields: count: peer-count established: established-count ''' globals().update(FactoryLoader().load(yaml.load(yml))) node_list = ['10.83.20.68', '10.83.20.69', '10.83.20.70', '10.83.20.71'] abr_list = ['10.83.20.66', '10.83.20.67'] for node in node_list + abr_list: ddev = getConnection(node, 'lab') bgp_group = BGPGroup(ddev).get() for group in bgp_group: if (group.count != group.established): print 'bgp connection lost' else: print 'dont panic!'
The results of his workDEBUG - getting ssh connection to 10.83.20.68
DEBUG - ssh cionnection to host 10.83.20.68 established
DEBUG - connection 10.83.20.68 named r1 established
dont panic!
DEBUG - getting ssh connection to 10.83.20.69
DEBUG - ssh cionnection to host 10.83.20.69 established
DEBUG - connection 10.83.20.69 named r2 established
dont panic!
DEBUG - getting ssh connection to 10.83.20.70
DEBUG - ssh cionnection to host 10.83.20.70 established
DEBUG - connection 10.83.20.70 named r3 established
dont panic!
DEBUG - getting ssh connection to 10.83.20.71
DEBUG - ssh cionnection to host 10.83.20.71 established
DEBUG - connection 10.83.20.71 named r4 established
dont panic!
DEBUG - getting ssh connection to 10.83.20.66
DEBUG - ssh cionnection to host 10.83.20.66 established
DEBUG - connection 10.83.20.66 named abr1 established
dont panic!
DEBUG - getting ssh connection to 10.83.20.67
DEBUG - ssh cionnection to host 10.83.20.67 established
DEBUG - connection 10.83.20.67 named abr2 established
dont panic!
Up to now, we have been talking mostly about some kind of networking things, but I haven't said a word about the program code, which seems to be the focus of attention in an article with this title. Firstly, it seems to me that thoughts are much more important than code, by formalizing the entities in the head, an engineer can turn them into a tool and put it in the form of code. Secondly, I do not want to repeat, all that may not seem obvious in these examples, as well as the minimum necessary knowledge to start working with Python and Pyez, are contained in the previous article of the cycle. Thirdly, the configuration preparation code performs its work, which is called offline and does not have an instant effect on the network, therefore, it is unlikely that it will cause any interest. The situation is somewhat different with the implementation code of the implementation stage; the development of these procedures raises the following questions:
- How to check that the entire volume of commands is adequately perceived by the interpreter?
- How to verify that changes made to the configuration have been applied?
- How to implement a transactional scheme for making configuration?
- How to roll back the configuration in case of loss of control?
- How to clean up after you if the interpreter reported an error during the transfer of commands?
The more attention will be paid to these issues, the less often there will be surprises during the execution stage. Imagine what a syntax error in the description of the routing policy can bring when the classifiers of this policy are only partially approved by the interpreter. If you do not check line by line the process of merging this policy with the current configurations, it is possible with one keystroke to transfer a pile of equipment into an inadequate state. Therefore, I adhere to about such a block diagram of the stage of execution.

Armed with the
Pyez documentation, the following universal configuration loader code was compiled, which you can use in your daily work, just as I use it in my.
conf_change.py import sys import yaml from jnpr.junos.factory.factory_loader import FactoryLoader from jnpr.junos import Device from jnpr.junos.utils.config import Config import copy import re import traceback import time import random from jnpr.junos.exception import * import os.path yml = ''' --- VersionInfo: rpc: get-software-information item: software-information view: VersionInfoView VersionInfoView: fields: name: host-name ''' Device.auto_probe = 3 ip_f_name = 'ip-list-1.txt' cur_stage='2' globals().update(FactoryLoader().load(yaml.load(yml))) def doTestOSPF(p_dev, p_node, f_do): print ' DEBUG --- doTestOSPF : at ' + p_node if ( p_dev == None ): print ' DEBUG --- ERROR --- doTestOSPF : connection to ' + p_node + ' is None' return else: try: d_conf = p_dev.cli("show configuration | display set").split('\n') ret_val = True set_found = 0 c_path = 'st' + cur_stage + '-' + p_node + '.txt' with open(c_path, "r") as f: for line in f: c_line = line.replace('\n', '').replace('\r\n', '') if ('delete ' not in c_line): set_found = 1 if ( (c_line not in d_conf) and (c_line != '')): print ' DEBUG --- doTestOSPF found missing line ' + c_line ret_val = False f.close() if ( (set_found == 0) and (f_do == True) ): return False return ret_val except Exception as ex: print ' DEBUG --- ERROR --- doTestOSPF : connection to ' + p_node + ' was not established. ex:' + str(ex) return def doTest(p_dev, p_node, f_do): return doTestOSPF(p_dev, p_node, f_do) def close_dev(d): try: d.close() except Exception as ex: print ' DEBUG --- ERROR --- close_dev : connection to cant be closed. ex:' + str(ex) def getConnection(p_host, p_user): acc = {'lab': 'lab123'} try: print ' DEBUG --- getting ssh connection to ' + p_host l_dev = Device(host=p_host, user=p_user, password=acc[p_user], auto_probe=2, gather_facts=True, port=22) l_dev.open() if (l_dev.connected): l_dev.timeout = 900 print ' DEBUG --- ssh cionnection to host ' + p_host + ' established' v = VersionInfo(l_dev).get() print ' DEBUG --- connection ' + p_host + ' named ' + l_dev.facts['hostname'] + ' established ' return l_dev else: raise Exception(' DEBUG --- ssh connection to ' + p_host + ' was not established') except Exception as ex: print ' DEBUG --- ERROR --- getConnection : connection to ' + p_host + ' was not established. ex:' + str(ex) traceback.print_exc() return def doCompare(p_conf, p_node): try: print ' DEBUG --- doCompare at ' + p_node if ( p_conf.diff() == None ): return False else: return True except Exception as ex: print ' DEBUG --- ERROR --- doCompare : conf.diff at ' + p_node + ' ex:' + str(ex) return def doLoad(p_conf, p_node): try: print ' DEBUG --- doLoad at ' + p_node c_path = 'st' + cur_stage + '-' + p_node + '.txt' if (os.path.isfile(c_path)): p_conf.load(path=c_path, format='set') return True except Exception as ex: print ' DEBUG --- ERROR --- doLoad : cant load config to ' + p_node + ' ex:' + str(ex) return def doRollback(p_conf, p_node, p_r): try: print ' DEBUG --- doRollback at ' + p_node if ( p_conf.rollback(rb_id=p_r) == True ): return True else: return False except Exception as ex: print ' DEBUG --- ERROR --- doRollback : cant rollback config to ' + p_node + ' ex:' + str(ex) return None def doCommitCheck(p_conf, p_node): try: print ' DEBUG --- doCommitCheck at ' + p_node p_conf.commit_check() return True except Exception as ex: print ' DEBUG --- ERROR --- doCommitCheck : cant config commit check config to ' + p_node + ' ex:' + str(ex) return None def doCommit(p_conf, p_node, p_confirm_m=None): try: print ' DEBUG --- doCommit at ' + p_node commit_res = None if (p_confirm_m == None): commit_res = p_conf.commit(timeout=30) else: commit_res = p_conf.commit(confirm=p_confirm_m, timeout=30) if (commit_res == True): return True else: return False except CommitError as c_ex: print ' DEBUG --- ERROR --- doCommit : cant config commit at ' + p_node + ' ex:' + str(c_ex) return None except RpcTimeoutError as t_ex: print ' DEBUG --- ERROR --- doCommit : config was commited at ' + p_node + ' with the following ex:' + str(t_ex) return True def doJob(p_dev, p_node): print ' DEBUG --- doJob at ' + p_node if ( p_dev == None ): print ' DEBUG --- ERROR --- doJob : connection to ' + p_node + ' is None' return else: try: with Config(p_dev) as conf: is_compare = doCompare(conf, node) if ( is_compare == None ): print ' DEBUG --- ERROR --- doJob : at config compare ' + node return if ( is_compare == True ): print ' DEBUG --- ERROR --- doJob : configuration locked at ' + node return False print ' DEBUG --- starting to do config changes at ' + node if ( doLoad(conf, node) != True ): print ' DEBUG --- ERROR --- doJob : conf.load ' + node if ( doCompare(conf, node) != False ): print ' DEBUG --- doJob : doing rollback after load at ' + node + ' deleting :' + str(conf.diff()) doRollback(conf, node, 0) return print ' DEBUG --- commit check at ' + node if (doCommitCheck(conf, node) != True): print ' DEBUG --- ERROR --- doJob : conf.doCommitCheck failed at ' + node if ( doCompare(conf, node) != False ): print ' DEBUG --- doJob : doing rollback after load at ' + node + ' deleting :' + str(conf.diff()) doRollback(conf, node, 0) return commit_m = 5 print ' DEBUG --- commiting changes at ' + node if (doCommit(conf, node, commit_m) != True): print ' DEBUG --- ERROR --- doJob : conf.commit ' + node if ( doCompare(conf, node) != False ): print ' DEBUG --- doJob : doing rollback after commit at ' + node + ' deleting :' + str(conf.diff()) doRollback(conf, node, 0) return True except Exception as ex: print ' DEBUG --- ERROR --- doJob : cant do job ' + node + ' ex:' + str(ex) return node_list = [] result_list = {} with open(ip_f_name, "r") as f_ip: for line in f_ip: c_ip_line = line.replace('\n', '').replace('\r\n', '') if (c_ip_line != ''): node_list.append(c_ip_line) for node in node_list: print 'FLOW -- ************************************ ' print 'FLOW -- checking ' + node result_list.setdefault(node, {}) cur_dev = getConnection(node, 'lab') is_test = doTest(cur_dev, node, True) if( is_test == None): print 'FLOW -- error' result_list.setdefault(node, {}).setdefault('status', 'error') break if( is_test == True): print 'FLOW -- conf exist' result_list.setdefault(node, {}).setdefault('status', 'nn') if( is_test == False): print 'FLOW -- conf not exist, doing change' is_job = doJob(cur_dev, node) if( is_job == None): print 'FLOW -- cant do job at ' + node result_list.setdefault(node, {}).setdefault('status', 'error') break if( is_job == False): print 'FLOW -- cant do job at ' + node result_list.setdefault(node, {}).setdefault('status', 'not_done') if( is_job == True): print 'FLOW -- done job at ' + node print 'FLOW -- going sleep at ' + node time.sleep(5) print 'FLOW -- checking job status ' + node cur_dev_confirm = getConnection(node, 'lab') if ( cur_dev_confirm != None ): if (doTest(cur_dev, node, False) == True): print 'FLOW -- commiting the configuration at ' + node if (doCommit(Config(cur_dev_confirm), node) != True): print 'FLOW -- ERROR cant commit the configuration at ' + node result_list.setdefault(node, {}).setdefault('status', 'not_done') break else: print 'FLOW -- configuration commited at ' + node result_list.setdefault(node, {}).setdefault('status', 'done') else: print 'FLOW -- ERROR cant find conf after job ' + node result_list.setdefault(node, {}).setdefault('status', 'not_done') close_dev(cur_dev_confirm) else: print 'FLOW -- ERROR cant access ' + node + ' for commiting' result_list.setdefault(node, {}).setdefault('status', 'not_done') close_dev(cur_dev) print result_list
And the results of his work in three stages
Hidden textPython 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
==== RESTART: C:\Users\and_andreev\Desktop\tools\lab-case2\conf_change.py ====
FLOW -- ************************************
FLOW -- checking 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.66
DEBUG --- doCompare at 10.83.20.66
DEBUG --- starting to do config changes at 10.83.20.66
DEBUG --- doLoad at 10.83.20.66
DEBUG --- commit check at 10.83.20.66
DEBUG --- doCommitCheck at 10.83.20.66
DEBUG --- commiting changes at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- done job at 10.83.20.66
FLOW -- going sleep at 10.83.20.66
FLOW -- checking job status 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
FLOW -- commiting the configuration at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- configuration commited at 10.83.20.66
FLOW -- ************************************
FLOW -- checking 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.67
DEBUG --- doCompare at 10.83.20.67
DEBUG --- starting to do config changes at 10.83.20.67
DEBUG --- doLoad at 10.83.20.67
DEBUG --- commit check at 10.83.20.67
DEBUG --- doCommitCheck at 10.83.20.67
DEBUG --- commiting changes at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- done job at 10.83.20.67
FLOW -- going sleep at 10.83.20.67
FLOW -- checking job status 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
FLOW -- commiting the configuration at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- configuration commited at 10.83.20.67
FLOW -- ************************************
FLOW -- checking 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.68
DEBUG --- doCompare at 10.83.20.68
DEBUG --- starting to do config changes at 10.83.20.68
DEBUG --- doLoad at 10.83.20.68
DEBUG --- commit check at 10.83.20.68
DEBUG --- doCommitCheck at 10.83.20.68
DEBUG --- commiting changes at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- done job at 10.83.20.68
FLOW -- going sleep at 10.83.20.68
FLOW -- checking job status 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
FLOW -- commiting the configuration at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- configuration commited at 10.83.20.68
FLOW -- ************************************
FLOW -- checking 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.69
DEBUG --- doCompare at 10.83.20.69
DEBUG --- starting to do config changes at 10.83.20.69
DEBUG --- doLoad at 10.83.20.69
DEBUG --- commit check at 10.83.20.69
DEBUG --- doCommitCheck at 10.83.20.69
DEBUG --- commiting changes at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- done job at 10.83.20.69
FLOW -- going sleep at 10.83.20.69
FLOW -- checking job status 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
FLOW -- commiting the configuration at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- configuration commited at 10.83.20.69
FLOW -- ************************************
FLOW -- checking 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/0.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.70
DEBUG --- doCompare at 10.83.20.70
DEBUG --- starting to do config changes at 10.83.20.70
DEBUG --- doLoad at 10.83.20.70
DEBUG --- commit check at 10.83.20.70
DEBUG --- doCommitCheck at 10.83.20.70
DEBUG --- commiting changes at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- done job at 10.83.20.70
FLOW -- going sleep at 10.83.20.70
FLOW -- checking job status 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
FLOW -- commiting the configuration at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- configuration commited at 10.83.20.70
FLOW -- ************************************
FLOW -- checking 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/1.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/2.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface ge-0/0/3.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.71
DEBUG --- doCompare at 10.83.20.71
DEBUG --- starting to do config changes at 10.83.20.71
DEBUG --- doLoad at 10.83.20.71
DEBUG --- commit check at 10.83.20.71
DEBUG --- doCommitCheck at 10.83.20.71
DEBUG --- commiting changes at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- done job at 10.83.20.71
FLOW -- going sleep at 10.83.20.71
FLOW -- checking job status 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
FLOW -- commiting the configuration at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- configuration commited at 10.83.20.71
{'10.83.20.70': {'status': 'done'}, '10.83.20.71': {'status': 'done'}, '10.83.20.67': {'status': 'done'}, '10.83.20.66': {'status': 'done'}, '10.83.20.69': {'status': 'done'}, '10.83.20.68': {'status': 'done'}}
>>>
>>>
>>>
==== RESTART: C:\Users\and_andreev\Desktop\tools\lab-case2\conf_change.py ====
FLOW -- ************************************
FLOW -- checking 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.66
DEBUG --- doCompare at 10.83.20.66
DEBUG --- starting to do config changes at 10.83.20.66
DEBUG --- doLoad at 10.83.20.66
DEBUG --- commit check at 10.83.20.66
DEBUG --- doCommitCheck at 10.83.20.66
DEBUG --- commiting changes at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- done job at 10.83.20.66
FLOW -- going sleep at 10.83.20.66
FLOW -- checking job status 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
FLOW -- commiting the configuration at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- configuration commited at 10.83.20.66
FLOW -- ************************************
FLOW -- checking 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 metric 1
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.67
DEBUG --- doCompare at 10.83.20.67
DEBUG --- starting to do config changes at 10.83.20.67
DEBUG --- doLoad at 10.83.20.67
DEBUG --- commit check at 10.83.20.67
DEBUG --- doCommitCheck at 10.83.20.67
DEBUG --- commiting changes at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- done job at 10.83.20.67
FLOW -- going sleep at 10.83.20.67
FLOW -- checking job status 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
FLOW -- commiting the configuration at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- configuration commited at 10.83.20.67
FLOW -- ************************************
FLOW -- checking 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/2.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/2.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface lo0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface lo0.0 secondary
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.68
DEBUG --- doCompare at 10.83.20.68
DEBUG --- starting to do config changes at 10.83.20.68
DEBUG --- doLoad at 10.83.20.68
DEBUG --- commit check at 10.83.20.68
DEBUG --- doCommitCheck at 10.83.20.68
DEBUG --- commiting changes at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- done job at 10.83.20.68
FLOW -- going sleep at 10.83.20.68
FLOW -- checking job status 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
FLOW -- commiting the configuration at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- configuration commited at 10.83.20.68
FLOW -- ************************************
FLOW -- checking 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/0.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/0.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface lo0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface lo0.0 secondary
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.69
DEBUG --- doCompare at 10.83.20.69
DEBUG --- starting to do config changes at 10.83.20.69
DEBUG --- doLoad at 10.83.20.69
DEBUG --- commit check at 10.83.20.69
DEBUG --- doCommitCheck at 10.83.20.69
DEBUG --- commiting changes at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- done job at 10.83.20.69
FLOW -- going sleep at 10.83.20.69
FLOW -- checking job status 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
FLOW -- commiting the configuration at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- configuration commited at 10.83.20.69
FLOW -- ************************************
FLOW -- checking 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/0.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/0.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface lo0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface lo0.0 secondary
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.70
DEBUG --- doCompare at 10.83.20.70
DEBUG --- starting to do config changes at 10.83.20.70
DEBUG --- doLoad at 10.83.20.70
DEBUG --- commit check at 10.83.20.70
DEBUG --- doCommitCheck at 10.83.20.70
DEBUG --- commiting changes at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- done job at 10.83.20.70
FLOW -- going sleep at 10.83.20.70
FLOW -- checking job status 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
FLOW -- commiting the configuration at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- configuration commited at 10.83.20.70
FLOW -- ************************************
FLOW -- checking 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/1.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/2.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/2.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 secondary
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface ge-0/0/3.0 metric 1
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.250 interface lo0.0 interface-type p2p
DEBUG --- doTestOSPF found missing line set protocols ospf area 0.0.0.200 interface lo0.0 secondary
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.71
DEBUG --- doCompare at 10.83.20.71
DEBUG --- starting to do config changes at 10.83.20.71
DEBUG --- doLoad at 10.83.20.71
DEBUG --- commit check at 10.83.20.71
DEBUG --- doCommitCheck at 10.83.20.71
DEBUG --- commiting changes at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- done job at 10.83.20.71
FLOW -- going sleep at 10.83.20.71
FLOW -- checking job status 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
FLOW -- commiting the configuration at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- configuration commited at 10.83.20.71
{'10.83.20.70': {'status': 'done'}, '10.83.20.71': {'status': 'done'}, '10.83.20.67': {'status': 'done'}, '10.83.20.66': {'status': 'done'}, '10.83.20.69': {'status': 'done'}, '10.83.20.68': {'status': 'done'}}
>>>
==== RESTART: C:\Users\and_andreev\Desktop\tools\lab-case2\conf_change.py ====
FLOW -- ************************************
FLOW -- checking 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.66
DEBUG --- doCompare at 10.83.20.66
DEBUG --- starting to do config changes at 10.83.20.66
DEBUG --- doLoad at 10.83.20.66
DEBUG --- commit check at 10.83.20.66
DEBUG --- doCommitCheck at 10.83.20.66
DEBUG --- commiting changes at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- done job at 10.83.20.66
FLOW -- going sleep at 10.83.20.66
FLOW -- checking job status 10.83.20.66
DEBUG --- getting ssh connection to 10.83.20.66
DEBUG --- ssh cionnection to host 10.83.20.66 established
DEBUG --- connection 10.83.20.66 named abr1 established
DEBUG --- doTestOSPF : at 10.83.20.66
FLOW -- commiting the configuration at 10.83.20.66
DEBUG --- doCommit at 10.83.20.66
FLOW -- configuration commited at 10.83.20.66
FLOW -- ************************************
FLOW -- checking 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.67
DEBUG --- doCompare at 10.83.20.67
DEBUG --- starting to do config changes at 10.83.20.67
DEBUG --- doLoad at 10.83.20.67
DEBUG --- commit check at 10.83.20.67
DEBUG --- doCommitCheck at 10.83.20.67
DEBUG --- commiting changes at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- done job at 10.83.20.67
FLOW -- going sleep at 10.83.20.67
FLOW -- checking job status 10.83.20.67
DEBUG --- getting ssh connection to 10.83.20.67
DEBUG --- ssh cionnection to host 10.83.20.67 established
DEBUG --- connection 10.83.20.67 named abr2 established
DEBUG --- doTestOSPF : at 10.83.20.67
FLOW -- commiting the configuration at 10.83.20.67
DEBUG --- doCommit at 10.83.20.67
FLOW -- configuration commited at 10.83.20.67
FLOW -- ************************************
FLOW -- checking 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.68
DEBUG --- doCompare at 10.83.20.68
DEBUG --- starting to do config changes at 10.83.20.68
DEBUG --- doLoad at 10.83.20.68
DEBUG --- commit check at 10.83.20.68
DEBUG --- doCommitCheck at 10.83.20.68
DEBUG --- commiting changes at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- done job at 10.83.20.68
FLOW -- going sleep at 10.83.20.68
FLOW -- checking job status 10.83.20.68
DEBUG --- getting ssh connection to 10.83.20.68
DEBUG --- ssh cionnection to host 10.83.20.68 established
DEBUG --- connection 10.83.20.68 named r1 established
DEBUG --- doTestOSPF : at 10.83.20.68
FLOW -- commiting the configuration at 10.83.20.68
DEBUG --- doCommit at 10.83.20.68
FLOW -- configuration commited at 10.83.20.68
FLOW -- ************************************
FLOW -- checking 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.69
DEBUG --- doCompare at 10.83.20.69
DEBUG --- starting to do config changes at 10.83.20.69
DEBUG --- doLoad at 10.83.20.69
DEBUG --- commit check at 10.83.20.69
DEBUG --- doCommitCheck at 10.83.20.69
DEBUG --- commiting changes at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- done job at 10.83.20.69
FLOW -- going sleep at 10.83.20.69
FLOW -- checking job status 10.83.20.69
DEBUG --- getting ssh connection to 10.83.20.69
DEBUG --- ssh cionnection to host 10.83.20.69 established
DEBUG --- connection 10.83.20.69 named r2 established
DEBUG --- doTestOSPF : at 10.83.20.69
FLOW -- commiting the configuration at 10.83.20.69
DEBUG --- doCommit at 10.83.20.69
FLOW -- configuration commited at 10.83.20.69
FLOW -- ************************************
FLOW -- checking 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.70
DEBUG --- doCompare at 10.83.20.70
DEBUG --- starting to do config changes at 10.83.20.70
DEBUG --- doLoad at 10.83.20.70
DEBUG --- commit check at 10.83.20.70
DEBUG --- doCommitCheck at 10.83.20.70
DEBUG --- commiting changes at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- done job at 10.83.20.70
FLOW -- going sleep at 10.83.20.70
FLOW -- checking job status 10.83.20.70
DEBUG --- getting ssh connection to 10.83.20.70
DEBUG --- ssh cionnection to host 10.83.20.70 established
DEBUG --- connection 10.83.20.70 named r3 established
DEBUG --- doTestOSPF : at 10.83.20.70
FLOW -- commiting the configuration at 10.83.20.70
DEBUG --- doCommit at 10.83.20.70
FLOW -- configuration commited at 10.83.20.70
FLOW -- ************************************
FLOW -- checking 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
FLOW -- conf not exist, doing change
DEBUG --- doJob at 10.83.20.71
DEBUG --- doCompare at 10.83.20.71
DEBUG --- starting to do config changes at 10.83.20.71
DEBUG --- doLoad at 10.83.20.71
DEBUG --- commit check at 10.83.20.71
DEBUG --- doCommitCheck at 10.83.20.71
DEBUG --- commiting changes at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- done job at 10.83.20.71
FLOW -- going sleep at 10.83.20.71
FLOW -- checking job status 10.83.20.71
DEBUG --- getting ssh connection to 10.83.20.71
DEBUG --- ssh cionnection to host 10.83.20.71 established
DEBUG --- connection 10.83.20.71 named r4 established
DEBUG --- doTestOSPF : at 10.83.20.71
FLOW -- commiting the configuration at 10.83.20.71
DEBUG --- doCommit at 10.83.20.71
FLOW -- configuration commited at 10.83.20.71
{'10.83.20.70': {'status': 'done'}, '10.83.20.71': {'status': 'done'}, '10.83.20.67': {'status': 'done'}, '10.83.20.66': {'status': 'done'}, '10.83.20.69': {'status': 'done'}, '10.83.20.68': {'status': 'done'}}
>>>
- The Complete IS-IS Routing Protocol - Hannes Gredler, Walter Goralski
- OSPF; Anatomy of an Internet Routing Protocol - John T. Moy
- Network Mergers and Migrations: Junos Design and Implementation - Gonzalo Gomez Herrero, Jan Anton Bernal Van Der
- OSPF Multi-Area Adjacency - tools.ietf.org/html/rfc5185