@@ -47,7 +47,7 @@ class Server(object):
4747 optional_fields = [
4848 'plan' , 'core_number' , 'memory_amount' , 'boot_order' , 'firewall' , 'nic_model' ,
4949 'timezone' , 'video_model' , 'vnc_password' , 'password_delivery' , 'avoid_host' ,
50- 'login_user'
50+ 'login_user' , 'user_data'
5151 ]
5252
5353 def __init__ (self , server = None , ** kwargs ):
@@ -465,7 +465,7 @@ def _self_destruct():
465465 # first destroy server
466466 try_it_n_times (operation = self .destroy ,
467467 expected_error_codes = ['SERVER_STATE_ILLEGAL' ],
468- custom_error = 'stopping server failed' )
468+ custom_error = 'destroying server failed' )
469469
470470 # storages may be deleted instantly after server DELETE
471471 for storage in self .storage_devices :
@@ -481,7 +481,10 @@ def _self_destruct():
481481 self ._wait_for_state_change (['stopped' , 'started' ])
482482
483483 if self .state == 'started' :
484- self .stop ()
484+ try_it_n_times (operation = self .stop ,
485+ expected_error_codes = ['SERVER_STATE_ILLEGAL' ],
486+ custom_error = 'stopping server failed' )
487+
485488 self ._wait_for_state_change (['stopped' ])
486489
487490 if self .state == 'stopped' :
0 commit comments