Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Fix napalm validate so identical strings will work #288

Merged
merged 1 commit into from
Aug 2, 2017

Conversation

ktbyers
Copy link
Contributor

@ktbyers ktbyers commented Aug 1, 2017

Essence of change is this:

+            m = re.search(src, py23_compat.text_type(dst))
+            if m:
+                return bool(m)
+            else:
+                return src == dst

Basically try re.search first and if that fails, then look for exact string comparison.

I also eliminated an unnecessary 'else' from the code as it was serving no purpose.

@dbarrosop
Copy link
Member

LGTM, merging

@dbarrosop dbarrosop merged commit 4865720 into napalm-automation:develop Aug 2, 2017
bewing added a commit to bewing/napalm-base that referenced this pull request Aug 4, 2017
…to develop

* 'develop' of github.com:napalm-automation/napalm-base:
  Correct link under "compliance_report" function (napalm-automation#289)
  Fix napalm validate so identical strings will work (napalm-automation#288)
dbarrosop pushed a commit that referenced this pull request Aug 26, 2017
* Validate string before evaluating (#274)

* Bump version to 0.24.3 (#275)

* Fix napalm validate so identical strings will work (#288)

* Correct link under "compliance_report" function (#289)

Fixing a bad link in the documentation for "compliance_report" function.

* Convert napalm_base testing to tox (#284)

* Convert napalm_base testing to tox

* Update requirements and travis config

* @ogenstad to the rescue

* Remove unnecessary conftest.py

* Omit unit tests from coverage report

* py23 text_type

* Search parent modules in load_template

If an explicit template_path is not specified, build a list of
directories from the class MRO and pass them to FileSystemLoader

* load_template unit test fixes

* Test search path building

* If tox was merged I would've caught this

* PEP8

* Didn't use this subclass

* pylama

* Rename template directory

* Add requested value to the validate report (#291)

* Clean up search_path creation

* __enter__ was swallowing the exception and returning False (#299)

* __enter__ was swallowing the exception and returning False

* Unit test for context manager exceptions

* Test exception handling in __open__

* Refactoring context manager

* Remove constraint on _rpc method for MockDriver that requires junos profile (#301)

* Implemented generic napalm tool with debugging capabilities (#292)

* Implemented cl_napalm_show_tech

* Typo

* Typo

* Hide password

* Generalize napalm command tool

* Fix help

* Added deprecation warnings and rename to napalm

* unnecessary

* Minor fix

* Make pylama happy

* py3 requires you to cast keys and values into a list (#300)

* Version 0.25.0 (#302)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants