Updates the virtual machine configuration with the given object

    vm_ref
        Virtual machine managed object reference

    vm_config_spec
        Virtual machine config spec object to update
492168
def update_vm(vm_ref, vm_config_spec):
    '''
    
    '''
    vm_name = get_managed_object_name(vm_ref)
    log.trace('Updating vm \'%s\'', vm_name)
    try:
        task = vm_ref.ReconfigVM_Task(vm_config_spec)
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
    vm_ref = wait_for_task(task, vm_name, 'ReconfigureVM Task')
    return vm_ref
540958
def update_host(name, data, **api_opts):
    '''
    
    '''
    o = get_host(name=name, **api_opts)
    return update_object(objref=o['_ref'], data=data, **api_opts)
537205
def update_vcl(self, service_id, version_number, name_key, **kwargs):
		""""""
		body = self._formdata(kwargs, FastlyVCL.FIELDS)
		content = self._fetch("/service/%s/version/%d/vcl/%s" % (service_id, version_number, name_key), method="PUT", body=body)
		return FastlyVCL(self, content)
186447
def _parse_vmconfig(config, instances):
    '''
    
    '''
    vmconfig = None

    if isinstance(config, (salt.utils.odict.OrderedDict)):
        vmconfig = salt.utils.odict.OrderedDict()
        for prop in config:
            if prop not in instances:
                vmconfig[prop] = config[prop]
            else:
                if not isinstance(config[prop], (salt.utils.odict.OrderedDict)):
                    continue
                vmconfig[prop] = []
                for instance in config[prop]:
                    instance_config = config[prop][instance]
                    instance_config[instances[prop]] = instance
                    ## some property are lowercase
                    if 'mac' in instance_config:
                        instance_config['mac'] = instance_config['mac'].lower()
                    vmconfig[prop].append(instance_config)
    else:
        log.error('smartos.vm_present::parse_vmconfig - failed to parse')

    return vmconfig
238039
def reconfigure_cluster_vsan(cluster_ref, cluster_vsan_spec):
    '''
    
    '''
    cluster_name = salt.utils.vmware.get_managed_object_name(cluster_ref)
    log.trace('Reconfiguring vsan on cluster \'%s\': %s',
              cluster_name, cluster_vsan_spec)
    si = salt.utils.vmware.get_service_instance_from_managed_object(
        cluster_ref)
    vsan_cl_conf_sys = salt.utils.vsan.get_vsan_cluster_config_system(si)
    try:
        task = vsan_cl_conf_sys.VsanClusterReconfig(cluster_ref,
                                                    cluster_vsan_spec)
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise VMwareApiError('Not enough permissions. Required privilege: '
                             '{0}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise VMwareRuntimeError(exc.msg)
    _wait_for_tasks([task], si)
116772
def _create_vm(self, vm_config):
        
        try:
            vm_setup = self.compute.virtual_machines.create_or_update(
                self.running_instance_id, self.running_instance_id,
                vm_config
            )
        except Exception as error:
            raise AzureCloudException(
                'An exception occurred creating virtual machine: {0}'.format(
                    error
                )
            )

        vm_setup.wait()
873428
def setmem(domain, memory):
    '''
    
    '''
    vmtype = vm_virt_type(domain)
    if vmtype == 'OS':
        return __salt__['vmadm.update'](vm=domain, max_physical_memory=memory)
    elif vmtype == 'LX':
        return __salt__['vmadm.update'](vm=domain, max_physical_memory=memory)
    elif vmtype == 'KVM':
        log.warning('Changes will be applied after the VM restart.')
        return __salt__['vmadm.update'](vm=domain, ram=memory)
    else:
        raise CommandExecutionError('Unknown VM type')

    return False
1119323
def update(cls, id, memory, cores, console, password, background,
               max_memory):
        """"""
        if not background and not cls.intty():
            background = True

        vm_params = {}

        if memory:
            vm_params['memory'] = memory

        if cores:
            vm_params['cores'] = cores

        if console:
            vm_params['console'] = console

        if password:
            vm_params['password'] = password

        if max_memory:
            vm_params['vm_max_memory'] = max_memory

        result = cls.call('hosting.vm.update', cls.usable_id(id), vm_params)
        if background:
            return result

        # interactive mode, run a progress bar
        cls.echo('Updating your Virtual Machine %s.' % id)
        cls.display_progress(result)
265891
def update_config(self, cluster_config):
        
        for key, attr in [
                ('ssh_to', 'ssh_to'),
        ]:
            oldvalue = getattr(self, attr)
            try:
                newvalue = cluster_config[key]
            except KeyError:
                continue
            if key in cluster_config and newvalue != oldvalue:
                setattr(self, attr, newvalue)
                log.debug(
                    "Configuration attribute `%s` updated: %s -> %s",
                    key, oldvalue, newvalue)
554773
def update_config(self):
        
        dataset = self._top._config.dataset
        session = object_session(self._top._config)
        logger.debug(
            'Updating group config. dataset: {}, type: {}, key: {}'.format(dataset.vid, self._top._type, self._key))

        self._config, created = _get_config_instance(
            self, session,
            parent_id=self._parent._config.id, d_vid=dataset.vid,
            group=self._key, key=self._key, type=self._top._type, dataset = dataset)
        if created:
            self._top._cached_configs[self._get_path()] = self._config
        self._top._add_valid(self._config)

        if created:
            logger.debug(
                'New group config created and linked. config: {}'.format(self._config))
        else:
            logger.debug(
                'Existing group config linked. config: {}'.format(self._config))
1003875
def update_config(self, svc_config, **rt_configs):
    
    path = self._path() + '/config'

    if svc_config:
      data = config_to_api_list(svc_config)
    else:
      data = { }
    if rt_configs:
      rt_list = [ ]
      for rt, cfg in rt_configs.iteritems():
        rt_data = config_to_api_list(cfg)
        rt_data['roleType'] = rt
        rt_list.append(rt_data)
      data[ROLETYPES_CFG_KEY] = rt_list

    resp = self._get_resource_root().put(path, data = json.dumps(data))
    return self._parse_svc_config(resp)
1219533
def update_cluster(cluster_ref, cluster_spec):
    '''
    
    '''
    cluster_name = get_managed_object_name(cluster_ref)
    log.trace('Updating cluster \'%s\'', cluster_name)
    try:
        task = cluster_ref.ReconfigureComputeResource_Task(cluster_spec,
                                                           modify=True)
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
    wait_for_task(task, cluster_name, 'ClusterUpdateTask')
644076
def update_function_configuration(self, vpc_config):
        
        LOG.info('Updating configuration for lambda function: %s', self.app_name)

        try:
            self.lambda_client.update_function_configuration(
                Environment=self.lambda_environment,
                FunctionName=self.app_name,
                Runtime=self.runtime,
                Role=self.role_arn,
                Handler=self.handler,
                Description=self.description,
                Timeout=int(self.timeout),
                MemorySize=int(self.memory),
                VpcConfig=vpc_config)

            if self.concurrency_limit:
                self.lambda_client.put_function_concurrency(
                    FunctionName=self.app_name,
                    ReservedConcurrentExecutions=self.concurrency_limit
                )
            else:
                self.lambda_client.delete_function_concurrency(FunctionName=self.app_name)

        except boto3.exceptions.botocore.exceptions.ClientError as error:
            if 'CreateNetworkInterface' in error.response['Error']['Message']:
                message = '{0} is missing "ec2:CreateNetworkInterface"'.format(self.role_arn)
                LOG.debug(message)
                raise SystemExit(message)

            raise
        LOG.info('Updating Lambda function tags')

        lambda_arn = get_lambda_arn(self.app_name, self.env, self.region)
        self.lambda_client.tag_resource(Resource=lambda_arn, Tags={'app_group': self.group, 'app_name': self.app_name})

        LOG.info("Successfully updated Lambda configuration.")
370015
def venv_update(
        venv=DEFAULT_OPTION_VALUES['venv='],
        install=DEFAULT_OPTION_VALUES['install='],
        pip_command=DEFAULT_OPTION_VALUES['pip-command='],
        bootstrap_deps=DEFAULT_OPTION_VALUES['bootstrap-deps='],
):
    

    # SMELL: mutable argument as return value
    class return_values(object):
        venv_path = None

    try:
        ensure_virtualenv(venv, return_values)
        if return_values.venv_path is None:
            return
        # invariant: the final virtualenv exists, with the right python version
        raise_on_failure(lambda: pip_faster(return_values.venv_path, pip_command, install, bootstrap_deps))
    except BaseException:
        mark_venv_invalid(return_values.venv_path)
        raise
    else:
        mark_venv_valid(return_values.venv_path)
518414
def _fix_orig_vcf_refs(data):
    
    variantcaller = tz.get_in(("config", "algorithm", "variantcaller"), data)
    if variantcaller:
        data["vrn_file_orig"] = data["vrn_file"]
    for i, sub in enumerate(data.get("group_orig", [])):
        sub_vrn = sub.pop("vrn_file", None)
        if sub_vrn:
            sub["vrn_file_orig"] = sub_vrn
            data["group_orig"][i] = sub
    return data
44851
function update(form) {
      // refuse to work with invalid data
      if (!vm.clientModelDoc._id || form && !form.$valid) {
        return;
      }

      ClientModelDocService.update(vm.clientModelDoc)
        .then(updateClientModelDocSuccess)
        .catch(updateClientModelDocCatch);

      function updateClientModelDocSuccess(updatedClientModelDoc) {
        // update the display name after successful save
        vm.displayName = updatedClientModelDoc.name;
        Toast.show({text: 'ClientModelDoc ' + vm.displayName + ' updated'});
        if (form) {
          form.$setPristine();
        }
      }

      function updateClientModelDocCatch(err) {
        Toast.show({
          type: 'warn',
          text: 'Error while updating ClientModelDoc ' + vm.displayName,
          link: {state: $state.$current, params: $stateParams}
        });

        if (form && err) {
          form.setResponseErrors(err.data);
        }
      }
    }
135982
def update_dvportgroup(portgroup_ref, spec):
    '''
    
    '''
    pg_name = get_managed_object_name(portgroup_ref)
    log.trace('Updating portgrouo %s', pg_name)
    try:
        task = portgroup_ref.ReconfigureDVPortgroup_Task(spec)
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{0}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
    wait_for_task(task, pg_name, six.text_type(task.__class__))