"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "salt/utils/napalm.py" between
salt-2019.2.0.tar.gz and salt-2019.2.1.tar.gz

About: SaltStack is a systems management software for data center automation, cloud orchestration, server provisioning, configuration management and more. Community version.

napalm.py  (salt-2019.2.0):napalm.py  (salt-2019.2.1)
skipping to change at line 485 skipping to change at line 485
closing = call(device, 'close', __retry=False) closing = call(device, 'close', __retry=False)
return ret return ret
return func_wrapper return func_wrapper
def default_ret(name): def default_ret(name):
''' '''
Return the default dict of the state output. Return the default dict of the state output.
''' '''
ret = { ret = {
'name': name, 'name': name,
'pchanges': {},
'changes': {}, 'changes': {},
'result': False, 'result': False,
'comment': '' 'comment': ''
} }
return ret return ret
def loaded_ret(ret, loaded, test, debug, compliance_report=False, opts=None): def loaded_ret(ret, loaded, test, debug, compliance_report=False, opts=None):
''' '''
Return the final state output. Return the final state output.
ret ret
The initial state output structure. The initial state output structure.
loaded loaded
The loaded dictionary. The loaded dictionary.
''' '''
# Always get the comment # Always get the comment
changes = {} changes = {}
pchanges = {}
ret['comment'] = loaded['comment'] ret['comment'] = loaded['comment']
if 'diff' in loaded: if 'diff' in loaded:
changes['diff'] = loaded['diff'] changes['diff'] = loaded['diff']
pchanges['diff'] = loaded['diff']
if 'commit_id' in loaded: if 'commit_id' in loaded:
changes['commit_id'] = loaded['commit_id'] changes['commit_id'] = loaded['commit_id']
pchanges['commit_id'] = loaded['commit_id']
if 'compliance_report' in loaded: if 'compliance_report' in loaded:
if compliance_report: if compliance_report:
changes['compliance_report'] = loaded['compliance_report'] changes['compliance_report'] = loaded['compliance_report']
pchanges['compliance_report'] = loaded['compliance_report']
if debug and 'loaded_config' in loaded: if debug and 'loaded_config' in loaded:
changes['loaded_config'] = loaded['loaded_config'] changes['loaded_config'] = loaded['loaded_config']
pchanges['loaded_config'] = loaded['loaded_config']
ret['pchanges'] = pchanges
if changes.get('diff'): if changes.get('diff'):
ret['comment'] = '{comment_base}\n\nConfiguration diff:\n\n{diff}'.forma t(comment_base=ret['comment'], ret['comment'] = '{comment_base}\n\nConfiguration diff:\n\n{diff}'.forma t(comment_base=ret['comment'],
diff=changes['diff']) diff=changes['diff'])
if changes.get('loaded_config'): if changes.get('loaded_config'):
ret['comment'] = '{comment_base}\n\nLoaded config:\n\n{loaded_cfg}'.form at( ret['comment'] = '{comment_base}\n\nLoaded config:\n\n{loaded_cfg}'.form at(
comment_base=ret['comment'], comment_base=ret['comment'],
loaded_cfg=changes['loaded_config']) loaded_cfg=changes['loaded_config'])
if changes.get('compliance_report'): if changes.get('compliance_report'):
ret['comment'] = '{comment_base}\n\nCompliance report:\n\n{compliance}'. format( ret['comment'] = '{comment_base}\n\nCompliance report:\n\n{compliance}'. format(
comment_base=ret['comment'], comment_base=ret['comment'],
 End of changes. 6 change blocks. 
7 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)