Code Monkey home page Code Monkey logo

Comments (4)

pszulczewski avatar pszulczewski commented on August 15, 2024

#34 was related to diff processing and there were no changes to get_value method and ref_key processing.
You compare ['connected'] with ['down'] and it's the right result, as Management1 is not present in these data structures.

It looks to me like get_value is not giving you desired result. It exits get_value method here: https://github.com/networktocode-llc/netcompare/blob/da7675a8a6d85cc0ae2b73c1a1e3d6aa419ce1a2/netcompare/check_types.py#L68

I think we have a new case that we haven't faced yet.

from jdiff.

lvrfrc87 avatar lvrfrc87 commented on August 15, 2024

@pszulczewski Ignore this! Was a late evening run... You are right, this is another case and in my opinion, is a wrong JMSPATH implementation: there is no point to reference key a interface name. I will do some more test around it and let you know.

from jdiff.

lvrfrc87 avatar lvrfrc87 commented on August 15, 2024

The right way to write that JMSPATH expression would be:

>>> my_jmspath = "result[*].interfaces.*.[$name$,interfaceStatus]"
>>> pre_value = my_check.get_value(output=pre_data, path=my_jmspath)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/olivierif/git/ntc/networktocode-llc/netcompare/netcompare/check_types.py", line 90, in get_value
    return keys_values_zipper(list_of_reference_keys, paired_key_value)
  File "/Users/olivierif/git/ntc/networktocode-llc/netcompare/netcompare/utils/jmespath_parsers.py", line 116, in keys_values_zipper
    final_result.append({my_key: wanted_value_with_key[my_index]})
TypeError: unhashable type: 'list'

Still throw an error though. I will investigate...

from jdiff.

lvrfrc87 avatar lvrfrc87 commented on August 15, 2024

Fix in https://github.com/networktocode-llc/netcompare/pull/45

from jdiff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.