File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
tests/integration/targets/regression/tasks Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change
1
+ bugfix :
2
+ - Fix bug introduced by # 247 to deal with tags
Original file line number Diff line number Diff line change @@ -870,11 +870,10 @@ def _update_netbox_object(self, data):
870
870
"""
871
871
serialized_nb_obj = self .nb_object .serialize ()
872
872
updated_obj = serialized_nb_obj .copy ()
873
+ updated_obj .update (data )
873
874
if serialized_nb_obj .get ("tags" ) and data .get ("tags" ):
874
875
serialized_nb_obj ["tags" ] = set (serialized_nb_obj ["tags" ])
875
876
updated_obj ["tags" ] = set (data ["tags" ])
876
- else :
877
- updated_obj .update (data )
878
877
879
878
if serialized_nb_obj == updated_obj :
880
879
return serialized_nb_obj , None
Original file line number Diff line number Diff line change 90
90
device_role : " Core Switch"
91
91
site : " Test Site"
92
92
status : " Staged"
93
+ asset_tag : " 1234"
93
94
tags :
94
95
- second
95
96
- third
134
135
- test_six.results[3]["diff"]["before"]["state"] == "absent"
135
136
- test_six.results[3]["diff"]["after"]["state"] == "present"
136
137
- test_six.results[3]["interface_template"]["device_type"] == 3
138
+
139
+ - name : " 7 - Don't prevent updates to other params if tags are specified"
140
+ netbox.netbox.netbox_device :
141
+ netbox_url : " http://localhost:32768"
142
+ netbox_token : " 0123456789abcdef0123456789abcdef01234567"
143
+ data :
144
+ name : " issue-242"
145
+ device_type : " Cisco Test"
146
+ device_role : " Core Switch"
147
+ site : " Test Site"
148
+ status : " Staged"
149
+ asset_tag : " Null"
150
+ tags :
151
+ - second
152
+ - third
153
+ - first
154
+ register : test_seven
155
+
156
+ - name : " 5 - Assert added tag - Tests #242 is fixed"
157
+ assert :
158
+ that :
159
+ - test_seven is changed
160
+ - test_seven["diff"]["after"]["asset_tag"] == "Null"
161
+ - test_seven["device"]["asset_tag"] == "Null"
You can’t perform that action at this time.
0 commit comments