Skip to content

_get_initial_value_order seems to be flawed #209

Open

Description

@milan2655

Environment

  • DiffSync version: 1.7.0
  • Python version 3.10.6

Output of the method get_tree_traversal() doesn't show correct order.

NautobotAdapter
── site
│   ├── device
│   │   └── interface
│   │       └── aip_address
│── aip_address

if the ip_class doesn't start with "a", output ios ok.
 
NautobotAdapter
── site
│   ├── device
│   │   └── interface
│   │       └── ip_address

BR Milan

Activity

  1. itdependsnetworks commented on Feb 22, 2023

    @itdependsnetworks
    Contributor

    Can you show what your DiffSync class looks like?

  2. milan2655 commented on Feb 22, 2023

    @milan2655
    Author
    class NautobotAdapter(DiffSync):
        site = Site
        device = Device
        interface = Interface
        aip_address = IpAddress
    
       top_level = ["site"]
    
  3. Kircheneer commented on Feb 22, 2023

    @Kircheneer
    Contributor

    Can you try to come up with a minimal reproduction of this issue (i.e. does it always occur when a model name start with a?) and post the code in this issue that does that? Then we can troubleshoot it quickly and easily. Thanks!

  4. milan2655 commented on Feb 23, 2023

    @milan2655
    Author

    test.py.zip

    hallo,
    test file is attached. changing modelname from _modelname = "aip_address" to _modelname = "ip_address", change the output of the metod get_tree_traversal().
    br milan

  5. added
    status: acceptedThis issue has been accepted by the maintainers team for implementation
    and removed
    status: action requiredThis issue requires additional information to be actionable
    on Feb 23, 2023
  6. itdependsnetworks commented on Feb 23, 2023

    @itdependsnetworks
    Contributor

    Your children are mapping to ip_address and not aip_address.

    class Interface(DiffSyncModel):
        _children = {
            "ip_address": "ip_addresses",
        }
    
  7. milan2655 commented on Feb 23, 2023

    @milan2655
    Author

    i have changed mapping to aip_address:

    _children = {
        "aip_address": "ip_addresses",
    }
    

    and the output is not changed:

    NautobotAdapter
    ├── site
    │   └── device
    │       └── interface
    │           └── aip_address
    └── aip_address
    
  8. itdependsnetworks commented on Feb 23, 2023

    @itdependsnetworks
    Contributor

    Please show the full output, the issues can only be shown then. The prior as an example had clear issues, perhaps there are new ones.

  9. milan2655 commented on Feb 24, 2023

    @milan2655
    Author

    how do you mean full output?

  10. changed the title [-]get_tree_traversal[/-] [+] _get_initial_value_order seems to be flawed[/+] on Feb 24, 2023
  11. itdependsnetworks commented on Feb 24, 2023

    @itdependsnetworks
    Contributor

    I think I see the issue. I have updated the title. _get_initial_value_order seems to not take into consideration children beyond top level, so by the time it get's to children of children there is not a correct expectation of what order it should be processed in

  12. milan2655 commented on Feb 27, 2023

    @milan2655
    Author

    did you fix the issue?

  13. Kircheneer commented on Feb 27, 2023

    @Kircheneer
    Contributor

    did you fix the issue?

    No, the issue is not fixed at this time. However, do feel free to submit a PR with a fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedThis issue has been accepted by the maintainers team for implementationtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions