def kill_zombies(max_age = ZOMBIE)
      now = start = Time.now
      attempts = @options[:timeout].to_i / SLEEPWAIT

      # get rid of old instances
      instances = @gce_helper.list_instances(start, attempts)
      if instances
        instances.each do |instance|
          created = Time.parse(instance['creationTimestamp'])
          alive = (now - created )/60/60
          if alive >= max_age
            #kill it with fire!
            @logger.debug("Deleting zombie instance #{instance['name']}")
            @gce_helper.delete_instance( instance['name'], start, attempts )
          end
        end
      else
        @logger.debug("No zombie instances found")
      end

      # get rid of old disks
      disks = @gce_helper.list_disks(start, attempts)
      if disks
        disks.each do |disk|
          created = Time.parse(disk['creationTimestamp'])
          alive = (now - created )/60/60
          if alive >= max_age

            # kill it with fire!
            @logger.debug("Deleting zombie disk #{disk['name']}")
            @gce_helper.delete_disk( disk['name'], start, attempts )
          end
        end
      else
        @logger.debug("No zombie disks found")
      end

      # get rid of non-default firewalls
      firewalls = @gce_helper.list_firewalls( start, attempts)

      if firewalls && !firewalls.empty?
        firewalls.each do |firewall|
          @logger.debug("Deleting non-default firewall #{firewall['name']}")
          @gce_helper.delete_firewall( firewall['name'], start, attempts )
        end
      else
        @logger.debug("No zombie firewalls found")
      end
    end
def kill_zombies(max_age = ZOMBIE)
      now = start = Time.now
      attempts = @options[:timeout].to_i / SLEEPWAIT

      # get rid of old instances
      instances = @gce_helper.list_instances(start, attempts)
      if instances
        instances.each do |instance|
          created = Time.parse(instance['creationTimestamp'])
          alive = (now - created )/60/60
          if alive >= max_age
            #kill it with fire!
            @logger.debug("Deleting zombie instance #{instance['name']}")
            @gce_helper.delete_instance( instance['name'], start, attempts )
          end
        end
      else
        @logger.debug("No zombie instances found")
      end

      # get rid of old disks
      disks = @gce_helper.list_disks(start, attempts)
      if disks
        disks.each do |disk|
          created = Time.parse(disk['creationTimestamp'])
          alive = (now - created )/60/60
          if alive >= max_age

            # kill it with fire!
            @logger.debug("Deleting zombie disk #{disk['name']}")
            @gce_helper.delete_disk( disk['name'], start, attempts )
          end
        end
      else
        @logger.debug("No zombie disks found")
      end

      # get rid of non-default firewalls
      firewalls = @gce_helper.list_firewalls( start, attempts)

      if firewalls && !firewalls.empty?
        firewalls.each do |firewall|
          @logger.debug("Deleting non-default firewall #{firewall['name']}")
          @gce_helper.delete_firewall( firewall['name'], start, attempts )
        end
      else
        @logger.debug("No zombie firewalls found")
      end
    end
Shutdown and destroy Google Compute instances (including their associated
 disks and firewall rules) that have been alive longer than ZOMBIE hours.