netbox-docker icon indicating copy to clipboard operation
netbox-docker copied to clipboard

Problem with initializing device type and using anchors/alias

Open jose-pr opened this issue 2 years ago • 0 comments

Current Behavior

I was using a definition of a current device type to initialize another one, basically two versions of a switch one with front to rear airflow and another with rear to front airflow. So i aliased the default model added the unique prop model, .. and noticed that components such as interfaces and power ports were being populated by only one element without a name for all but the first device declaration.

Expected Behavior

When using an alias to not have to recreate components that are the same between type for it to work.

Issue seems seems to come from using pop to get the name for a property, as the yaml loader seems to share the common object when aliasing is used. Poossible solution that work for me is doing a copy.deepcopy of params, to create new object and for the pop not to affect other device types. Other possible solution would be not to pop.

Docker Compose Version

Not a docker issue

Docker Version

Not a docker issue.

The git Revision

Main/master

The git Status

Clean

Startup Command

Docker compose up

NetBox Logs

-

Content of docker-compose.override.yml

-

jose-pr avatar Aug 09 '22 22:08 jose-pr