def Insert(self):
        if self.__flags.config is None:
            sys.stderr.write(
                '--config must be specified pointing to a valid config file\n')
            sys.exit(1)

        instances = self._ListFromConfig()
        requests = []

        for instance in instances:
            instance_name = instance['name']
            if not self._InstanceInSelection(instance_name):
                if self.__flags.debug:
                    print 'Skipping instance %s [not in selection]' % instance_name
                continue

            print 'Inserting instance: %s' % instance_name
            if self.__flags.dry_run:
                continue
            request = self.__gce_service.instances().insert(project=self.__flags.project,
                                                            body=instance,
                                                            strict=True,
                                                            zone=self.__flags.zone)
            requests.append((instance_name, request))

        self._ExecuteBatchRequest(requests)
        print 'Done'
dataset/ETHPy150Open mbrukman/cloud-launcher/src/cloud_launcher.py/GceHandler.Insert/original