File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
samples/vsphere/vcenter/vm/hardware Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,9 @@ def run():
103
103
print ('vm.hardware.Parallel.get({}, {}) -> {}' .format (vm , parallel , pp (
104
104
parallel_info )))
105
105
106
+ # Make sure output file doesn't exist already
107
+ cleanup_backends ()
108
+
106
109
print ('\n # Example: Create Parallel port with defaults' )
107
110
parallel_create_spec = Parallel .CreateSpec ()
108
111
parallel = parallel_svc .create (vm , parallel_create_spec )
@@ -180,6 +183,9 @@ def run():
180
183
print ('vm.hardware.Parallel.list({}) -> {}' .
181
184
format (vm , parallel_summaries ))
182
185
186
+ # Always cleanup output file so the VM can be powered on next time
187
+ cleanup_backends ()
188
+
183
189
184
190
def cleanup ():
185
191
print ('\n # Cleanup: Delete VM Parallel ports that were added' )
@@ -193,8 +199,6 @@ def cleanup():
193
199
print ('vm.hardware.Parallel WARNING: '
194
200
'Final Parallel ports info does not match original' )
195
201
196
- cleanup_backends ()
197
-
198
202
199
203
def cleanup_backends ():
200
204
"""
Original file line number Diff line number Diff line change @@ -214,6 +214,9 @@ def run():
214
214
serial_summaries = serial_svc .list (vm = vm )
215
215
print ('vm.hardware.Serial.list({}) -> {}' .format (vm , serial_summaries ))
216
216
217
+ # Always cleanup output file so the VM can be powered on next time
218
+ cleanup_backends ()
219
+
217
220
218
221
def cleanup ():
219
222
print ('\n # Delete VM Serial ports that were added' )
@@ -227,8 +230,6 @@ def cleanup():
227
230
print ('vm.hardware.Serial WARNING: '
228
231
'Final Serial ports info does not match original' )
229
232
230
- cleanup_backends ()
231
-
232
233
233
234
def cleanup_backends ():
234
235
"""
You can’t perform that action at this time.
0 commit comments