removed functions from uninstall that may have been causing errors during the uninstall process; added an initializer for the atomicState.eventBuffer on update if it's whiped away; added a check for access key in createBucket to make the function more idempotent

This commit is contained in:
David Sulpy
2015-09-14 16:16:21 -05:00
parent 7baad1c35e
commit 80b4d6a665

View File

@@ -242,22 +242,26 @@ def updated() {
if (atomicState.bucketKey != null && atomicState.accessKey != null) {
atomicState.isBucketCreated = false
}
if (atomicState.eventBuffer == null) {
atomicState.eventBuffer = [];
}
subscribeToEvents()
log.debug "updated (version $atomicState.version)"
}
def uninstalled() {
unsubscribe()
unschedule()
log.debug "uninstalled (version $atomicState.version)"
}
def createBucket() {
if (!atomicState.bucketName) {
atomicState.bucketName = atomicState.bucketKey
atomicState.bucketName = atomicState.bucketKey;
}
if (!atomicState.accessKey) {
return;
}
def bucketName = "${atomicState.bucketName}"
def bucketKey = "${atomicState.bucketKey}"