Skip to content

Commit

Permalink
Merge pull request #137 from aristanetworks/releases/v1.0.x
Browse files Browse the repository at this point in the history
Hotfix for Issue #135  - v1.0.4a
  • Loading branch information
titom73 committed Feb 11, 2020
2 parents a189759 + 0c63d3e commit fe6dcd1
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -141,7 +141,7 @@ def compare(fromText, toText, fromName='', toName='', lines=10):
tolines = toText.splitlines(1)
diff = list(difflib.unified_diff(fromlines, tolines, fromName, toName, n=lines))
textComp = difflib.SequenceMatcher(None, fromText, toText)
diffRatio = round(textComp.quick_ratio() * 100, 2)
diffRatio = textComp.ratio()
return [diffRatio, diff]


Expand Down Expand Up @@ -203,7 +203,7 @@ def configlet_action(module):
ansible_configlet = module.params['configlets'][configlet['name']]
configlet_compare = compare(configlet['config'], ansible_configlet, 'CVP', 'Ansible')
# compare function returns a floating point number
if configlet_compare[0] == 100.0:
if configlet_compare[0] == 1.0:
keep_configlet.append(configlet)
else:
update_configlet.append({'data': configlet, 'config': ansible_configlet, 'diff': ''.join(configlet_compare[1])})
Expand Down

0 comments on commit fe6dcd1

Please sign in to comment.