File tree Expand file tree Collapse file tree
api/src/main/java/org/apache/cloudstack/api/command/user/template
test/integration/component Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616// under the License.
1717package org .apache .cloudstack .api .command .user .template ;
1818
19+ import org .apache .commons .lang3 .BooleanUtils ;
1920import org .apache .log4j .Logger ;
2021
2122import org .apache .cloudstack .api .APICommand ;
@@ -67,7 +68,7 @@ public Long getZoneId() {
6768 }
6869
6970 public boolean isForced () {
70- return (forced != null ) ? forced : true ;
71+ return BooleanUtils . toBooleanDefaultIfNull (forced , false ) ;
7172 }
7273 /////////////////////////////////////////////////////
7374 /////////////// API Implementation///////////////////
Original file line number Diff line number Diff line change @@ -123,12 +123,16 @@ def setUp(self):
123123
124124 def tearDown (self ):
125125 try :
126- # Clean up, terminate the created templates
127- cleanup_resources (self .apiclient , self .cleanup )
128-
129- except Exception as e :
130- raise Exception ("Warning: Exception during cleanup : %s" % e )
131- return
126+ # Clean up the created templates
127+ for temp in self .cleanup :
128+ cmd = deleteTemplate .deleteTemplateCmd ()
129+ cmd .id = temp .id
130+ cmd .zoneid = self .zone .id
131+ cmd .forced = True
132+ self .apiclient .deleteTemplate (cmd )
133+ except Exception as e :
134+ raise Exception ("Warning: Exception during cleanup : %s" % e )
135+ return
132136
133137 @classmethod
134138 def setUpClass (cls ):
You can’t perform that action at this time.
0 commit comments