imperialwicket/hubot-asgard — pull request #13 by danriti (2014-08-07 18:09:59+00:00)
Title: Update cluster template to display cluster details.

Greetings! I noticed an issue when using the `hubot-asgard` script's `cluster` command today:

```
Hubot> asgard cluster trusty_web
Hubot> [ { addingToLoadBalancerSuspended: true,
autoScalingGroupName: 'trusty_web-v004',
availabilityZones: [ 'us-east-1a', 'us-east-1b' ],
createdTime: '2014-08-04T20:50:46Z',
defaultCooldown: 300,
desiredCapacity: 0,
expirationDurationString: null,
expirationTime: null,
healthCheckGracePeriod: 0,
healthCheckType:
{ enumType: 'com.netflix.asgard.model.AutoScalingGroupHealthCheckType',
name: 'EC2' },
instances: [],
launchConfigurationName: 'trusty_web-v004-20140804205045',
launchingSuspended: true,
loadBalancerNames: [ 'trusty-web' ],
maxSize: 0,
minSize: 0,
mostCommonAppVersion: null,
scalingPolicies: [],
statesToInstanceList: {},
status: null,
suspendedPrimaryProcessTypes: [ [Object], [Object] ],
suspendedProcessTypes: [ [Object], [Object], [Object] ],
tags: [],
terminatingSuspended: true,
terminationPolicies: [ 'Default' ],
variables: {},
vpcZoneIdentifier: null,
zoneRebalancingSuspended: false } ]

Unknown response (This is probably a hubot-asgard bug).
```

It seems the template didn't have an `else if` block that can handle this JSON structure for clusters, so I've added a patch to make it work :+1:

```
Hubot> asgard cluster trusty_web
Hubot> [ { addingToLoadBalancerSuspended: true,
autoScalingGroupName: 'trusty_web-v004',
availabilityZones: [ 'us-east-1a', 'us-east-1b' ],
createdTime: '2014-08-04T20:50:46Z',
defaultCooldown: 300,
desiredCapacity: 0,
expirationDurationString: null,
expirationTime: null,
healthCheckGracePeriod: 0,
healthCheckType:
{ enumType: 'com.netflix.asgard.model.AutoScalingGroupHealthCheckType',
name: 'EC2' },
instances: [],
launchConfigurationName: 'trusty_web-v004-20140804205045',
launchingSuspended: true,
loadBalancerNames: [ 'trusty-web' ],
maxSize: 0,
minSize: 0,
mostCommonAppVersion: null,
scalingPolicies: [],
statesToInstanceList: {},
status: null,
suspendedPrimaryProcessTypes: [ [Object], [Object] ],
suspendedProcessTypes: [ [Object], [Object], [Object] ],
tags: [],
terminatingSuspended: true,
terminationPolicies: [ 'Default' ],
variables: {},
vpcZoneIdentifier: null,
zoneRebalancingSuspended: false } ]

AutoScalingGroupName: trusty_web-v004
Active: false
CreatedTime: 2014-08-04T20:50:46Z
InstanceCount: 0
Min/Des/Max: 0/0/0
```

Feel free to let me know if you have any questions or concerns! Thanks in advance :smile: