File tree Expand file tree Collapse file tree
test/integration/testpaths Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,24 +123,25 @@ def setUp(self):
123123 "Snapshots are not supported on %s" %
124124 self .hypervisor )
125125
126-
127126 def tearDown (self ):
128127 try :
129- data_volumes_list = Volume .list (
130- self .userapiclient ,
131- id = self .data_volume_created .id ,
132- virtualmachineid = self .vm .id
133- )
134- status = validateList (data_volumes_list )
135- self .assertEqual (
136- status [0 ],
137- PASS ,
138- "DATA Volume List Validation Failed" )
139-
140- self .vm .detach_volume (
141- self .userapiclient ,
142- data_volumes_list [0 ]
143- )
128+ if hasattr (self , "data_volume_created" ):
129+ data_volumes_list = Volume .list (
130+ self .userapiclient ,
131+ id = self .data_volume_created .id ,
132+ virtualmachineid = self .vm .id
133+ )
134+ status = validateList (data_volumes_list )
135+ self .assertEqual (
136+ status [0 ],
137+ PASS ,
138+ "DATA Volume List Validation Failed" )
139+
140+ if data_volumes_list :
141+ self .vm .detach_volume (
142+ self .userapiclient ,
143+ data_volumes_list [0 ]
144+ )
144145
145146 cleanup_resources (self .apiclient , self .cleanup )
146147 except Exception as e :
You can’t perform that action at this time.
0 commit comments