mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Default value of force should be false for template delete operation (#7731)
* default value of force should be false * Added force flag in tests
This commit is contained in:
parent
e290ac5451
commit
a9f3af85cb
@ -16,6 +16,7 @@
|
||||
// under the License.
|
||||
package org.apache.cloudstack.api.command.user.template;
|
||||
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import org.apache.cloudstack.api.APICommand;
|
||||
@ -67,8 +68,9 @@ public class DeleteTemplateCmd extends BaseAsyncCmd {
|
||||
}
|
||||
|
||||
public boolean isForced() {
|
||||
return (forced != null) ? forced : true;
|
||||
return BooleanUtils.toBooleanDefaultIfNull(forced, false);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////
|
||||
/////////////// API Implementation///////////////////
|
||||
/////////////////////////////////////////////////////
|
||||
|
||||
@ -115,6 +115,7 @@ class TestCreateTemplateWithChecksum(cloudstackTestCase):
|
||||
cmd = deleteTemplate.deleteTemplateCmd()
|
||||
cmd.id = temp.id
|
||||
cmd.zoneid = self.zone.id
|
||||
cmd.forced = True
|
||||
self.apiclient.deleteTemplate(cmd)
|
||||
except Exception as e:
|
||||
raise Exception("Warning: Exception during cleanup : %s" % e)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user