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,6 +242,9 @@ def updated() {
if (atomicState.bucketKey != null && atomicState.accessKey != null) { if (atomicState.bucketKey != null && atomicState.accessKey != null) {
atomicState.isBucketCreated = false atomicState.isBucketCreated = false
} }
if (atomicState.eventBuffer == null) {
atomicState.eventBuffer = [];
}
subscribeToEvents() subscribeToEvents()
@@ -249,15 +252,16 @@ def updated() {
} }
def uninstalled() { def uninstalled() {
unsubscribe()
unschedule()
log.debug "uninstalled (version $atomicState.version)" log.debug "uninstalled (version $atomicState.version)"
} }
def createBucket() { def createBucket() {
if (!atomicState.bucketName) { if (!atomicState.bucketName) {
atomicState.bucketName = atomicState.bucketKey atomicState.bucketName = atomicState.bucketKey;
}
if (!atomicState.accessKey) {
return;
} }
def bucketName = "${atomicState.bucketName}" def bucketName = "${atomicState.bucketName}"
def bucketKey = "${atomicState.bucketKey}" def bucketKey = "${atomicState.bucketKey}"