Added a test case. Removed setting of defaultTTL in config.

This commit is contained in:
vishalnayak
2015-10-03 15:36:57 -04:00
parent 02f11cb2da
commit e47b2838a0
3 changed files with 19 additions and 11 deletions

View File

@@ -54,9 +54,7 @@ func (b *backend) pathConfigWrite(
var ttl time.Duration
var err error
ttlRaw, ok := data.GetOk("ttl")
if !ok {
ttl = b.System().DefaultLeaseTTL()
} else if len(ttlRaw.(string)) == 0 {
if !ok || len(ttlRaw.(string)) == 0 {
ttl = 0
} else {
ttl, err = time.ParseDuration(ttlRaw.(string))
@@ -67,9 +65,7 @@ func (b *backend) pathConfigWrite(
var maxTTL time.Duration
maxTTLRaw, ok := data.GetOk("max_ttl")
if !ok {
maxTTL = b.System().MaxLeaseTTL()
} else if len(maxTTLRaw.(string)) == 0 {
if !ok || len(maxTTLRaw.(string)) == 0 {
maxTTL = 0
} else {
maxTTL, err = time.ParseDuration(maxTTLRaw.(string))