<commit_before>require 'i18n'

module VagrantPlugins
  module VCenter
    module Action
      # This class powers on the VM that the Vagrant provider is managing.
      class PowerOn
        def initialize(app, env)
          @app = app
          @logger = Log4r::Logger.new('vagrant_vcenter::action::power_on')
        end

        def call(env)
          config = env[:machine].provider_config
          # FIXME: Raise a correct exception
          dc = config.vcenter_cnx.serviceInstance.find_datacenter(
               config.datacenter_name) or abort 'datacenter not found'
          root_vm_folder = dc.vmFolder
          vm = root_vm_folder.findByUuid(env[:machine].id)

          # Poweron VM
          env[:ui].info('Powering on VM...')
          vm.PowerOnVM_Task.wait_for_completion
          sleep(3) until env[:machine].communicate.ready?
          @app.call env
        end
      end
    end
  end<commit_msg>make the poweron setting slightly more tollerable trying to connect.  its slow to bring up vms<commit_after>require 'i18n'

module VagrantPlugins
  module VCenter
    module Action
      # This class powers on the VM that the Vagrant provider is managing.
      class PowerOn
        def initialize(app, env)
          @app = app
          @logger = Log4r::Logger.new('vagrant_vcenter::action::power_on')
        end

        def call(env)
          config = env[:machine].provider_config
          # FIXME: Raise a correct exception
          dc = config.vcenter_cnx.serviceInstance.find_datacenter(
               config.datacenter_name) or abort 'datacenter not found'
          root_vm_folder = dc.vmFolder
          vm = root_vm_folder.findByUuid(env[:machine].id)

          # Poweron VM
          env[:ui].info('Powering on VM...')
          vm.PowerOnVM_Task.wait_for_completion
          sleep(20) until env[:machine].communicate.ready?
          @app.call env
        end
      end
    end
  end
{'fraction_non_alphanumeric': 0.0803941908713693, 'fraction_numerical': 0.00466804979253112, 'mean_word_length': 2.193708609271523, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1198521', 'n_tokens_mistral': 569, 'n_tokens_neox': 561, 'n_words': 146}