Skip to content

Features, bug fixes, cleanup#1

Open
internetstaff wants to merge 3 commits intoschen1628:masterfrom
internetstaff:master
Open

Features, bug fixes, cleanup#1
internetstaff wants to merge 3 commits intoschen1628:masterfrom
internetstaff:master

Conversation

@internetstaff
Copy link

Features:

  • Added support for timestamped logging with configuration (file, output level, rotation, etc) via command line arguments to avoid needing a configuration file
  • Added --dry-run option
  • Start/stop windows are now configurable and changed defaults
  • Do not re-stop an instance that has been started since the stop window began. This stops people from having to fight the script if they wanted to restart an instance that was shut down on them.
  • Iterate through all Elastic Load Balancers in the region and, if an instance being started was registered to one, pause, de-register it, then re-register it to make sure the instances come back online in the ELB. Otherwise, instances typically remained dead in ELBs despite being started back up.

Bug fixes:

  • A run at the exact window time would fail to start or stop instances, thus making the windows required. It should now work with no window as long as the start/stop tags match up with cron intervals (e.g. on 5 minute boundaries)

Code changes:

  • Separated, simplified, and clarified time to action logic
  • Added a simple unit test to confirm time to action logic functionality
  • Skip cn-north-1, us-gov-west-1 regions to avoid superfluous errors. This could be handled better, patches welcome.
  • Don't swallow potentially useful exceptions.

These improvements graciously donated by TASER's Evidence.com team. Join us: https://www.evidence.com/careers

* Added support for timestamped logging with configuration (file, output level, rotation, etc) via command line arguments to avoid needing a configuration file
* Added --dry-run option
* Start/stop windows are now configurable and changed defaults
* Do not re-stop an instance that has been started since the stop window began. This stops people from having to fight the script if they wanted to restart an instance that was shut down on them.
* Iterate through all Elastic Load Balancers in the region and, if an instance being started was registered to one, pause, de-register it, then re-register it to make sure the instances come back online in the ELB. Otherwise, instances typically remained dead in ELBs despite being started back up.

Bug fixes:

* A run at the exact window time would fail to start or stop instances, thus making the windows required. It should now work with no window as long as the start/stop tags match up with cron intervals (e.g. on 5 minute boundaries)

Code changes:
* Separated, simplified, and clarified time to action logic
* Added a simple unit test to confirm time to action logic functionality
* Skip cn-north-1, us-gov-west-1 regions to avoid superfluous errors. This could be handled better, patches welcome.
* Don't swallow potentially useful exceptions.

These improvements graciously donated by TASER's Evidence.com team. Join us: https://www.evidence.com/careers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant