Update the kernel image metadata from all configured docker registries.
192236
def rescan_images(registry):
    ''''''
    with Session() as session:
        try:
            result = session.Image.rescanImages(registry)
        except Exception as e:
            print_error(e)
            sys.exit(1)
        if result['ok']:
            print("kernel image metadata updated")
        else:
            print("rescanning failed: {0}".format(result['msg']))
1291358
def update_config_from_dockerfile(self, config):
        
        labels = Labels(df_parser(self.workflow.builder.df_path).labels)
        for config_key, label in (
            ('name', Labels.LABEL_TYPE_COMPONENT),
            ('version', Labels.LABEL_TYPE_VERSION),
        ):
            try:
                _, value = labels.get_name_and_value(label)
            except KeyError:
                pass
            else:
                config.set('image-build', config_key, value)
1081987
def update(self, newinfo):
        ''''''
        self.imgstr = newinfo.imgstr
        self.width = newinfo.width
        self.height = newinfo.height
        if self.imgpanel is not None:
            self.imgpanel.set_image(self.img())
251517
def metadata_update_endpoints(self):
        
        metadata = load_mpe_service_metadata(self.args.metadata_file)
        group_name = metadata.get_group_name_nonetrick(self.args.group_name)
        metadata.remove_all_endpoints_for_group(group_name)
        for endpoint in self.args.endpoints:
            metadata.add_endpoint(group_name, endpoint)
        metadata.save_pretty(self.args.metadata_file)
531837
def update_attributes(self, updates):
        """"""
        if not isinstance(updates, dict):
            updates = updates.to_dict()
        for sdk_key, spec_key in self._get_attributes_map().items():
            attr = '_%s' % sdk_key
            if spec_key in updates and not hasattr(self, attr):
                setattr(self, attr, updates[spec_key])
782734
def do_file_update_metadata(client, args):
    """"""
    client.update_file_metadata(args.uri, filename=args.filename,
                                description=args.description, mtime=args.mtime,
                                privacy=args.privacy)
    return True
733641
def update(self):
        """"""
        pids = fileops.readlines(self.paths['cgroup.procs'])
        self.pids = [int(pid) for pid in pids if pid != '']
        self.n_procs = len(pids)
441996
def create_image_metadata(data):
    """"""

    # Default metadata
    meta = {'protected': data.get('protected', False),
            'disk_format': data.get('disk_format', 'raw'),
            'container_format': data.get('container_format', 'bare'),
            'min_disk': data.get('min_disk') or 0,
            'min_ram': data.get('min_ram') or 0,
            'name': data.get('name', '')}

    # Glance does not really do anything with container_format at the
    # moment. It requires it is set to the same disk_format for the three
    # Amazon image types, otherwise it just treats them as 'bare.' As such
    # we will just set that to be that here instead of bothering the user
    # with asking them for information we can already determine.
    if meta['disk_format'] in ('ami', 'aki', 'ari',):
        meta['container_format'] = meta['disk_format']
    elif meta['disk_format'] == 'docker':
        # To support docker containers we allow the user to specify
        # 'docker' as the format. In that case we really want to use
        # 'raw' as the disk format and 'docker' as the container format.
        meta['disk_format'] = 'raw'
        meta['container_format'] = 'docker'
    elif meta['disk_format'] == 'ova':
        # If the user wishes to upload an OVA using Horizon, then
        # 'ova' must be the container format and 'vmdk' must be the disk
        # format.
        meta['container_format'] = 'ova'
        meta['disk_format'] = 'vmdk'

    properties = {}

    for prop, key in [('description', 'description'),
                      ('kernel_id', 'kernel'),
                      ('ramdisk_id', 'ramdisk'),
                      ('architecture', 'architecture')]:
        if data.get(key):
            properties[prop] = data[key]

    _handle_unknown_properties(data, properties)

    if ('visibility' in data and
            data['visibility'] not in ['public', 'private', 'community',
                                       'shared']):
        raise KeyError('invalid visibility option: %s' % data['visibility'])
    _normalize_is_public_filter(data)

    if VERSIONS.active < 2:
        meta['properties'] = properties
        meta['is_public'] = data.get('is_public', False)
    else:
        meta['visibility'] = data.get('visibility', 'private')
        meta.update(properties)

    return meta
188827
public function actionUpdate()
    {
        foreach ($this->repos as $repo) {
            $this->rebaseRepo($repo, $this->getFilesystemRepoPath($repo));
        }
        
        foreach ($this->getConfig(self::CONFIG_VAR_CUSTOMCLONES, []) as $repo => $path) {
            $this->rebaseRepo($repo, $path);
        }
    }
180642
def get_metadata(self):
        
        inspect_data = self.inspect(refresh=True)
        inspect_to_container_metadata(self.metadata, inspect_data, self.image)

        return self.metadata
830609
def kernel_image(self, kernel_image):
        

        kernel_image = self.manager.get_abs_image_path(kernel_image)
        log.info('QEMU VM "{name}" [{id}] has set the QEMU kernel image path to {kernel_image}'.format(name=self._name,
                                                                                                       id=self._id,
                                                                                                       kernel_image=kernel_image))
        self._kernel_image = kernel_image
720632
def update(self):
        """"""
        # Init new stats
        stats = self.get_init_value()

        if self.input_method == 'local':
            # Update stats using the standard system lib

            # Grab the stats using the psutil disk_partitions
            # If 'all'=False return physical devices only (e.g. hard disks, cd-rom drives, USB keys)
            # and ignore all others (e.g. memory partitions such as /dev/shm)
            try:
                fs_stat = psutil.disk_partitions(all=False)
            except UnicodeDecodeError:
                return self.stats

            # Optionnal hack to allow logicals mounts points (issue #448)
            # Ex: Had to put 'allow=zfs' in the [fs] section of the conf file
            #     to allow zfs monitoring
            for fstype in self.get_conf_value('allow'):
                try:
                    fs_stat += [f for f in psutil.disk_partitions(all=True) if f.fstype.find(fstype) >= 0]
                except UnicodeDecodeError:
                    return self.stats

            # Loop over fs
            for fs in fs_stat:
                # Do not take hidden file system into account
                if self.is_hide(fs.mountpoint):
                    continue
                # Grab the disk usage
                try:
                    fs_usage = psutil.disk_usage(fs.mountpoint)
                except OSError:
                    # Correct issue #346
                    # Disk is ejected during the command
                    continue
                fs_current = {
                    'device_name': fs.device,
                    'fs_type': fs.fstype,
                    # Manage non breaking space (see issue #1065)
                    'mnt_point': u(fs.mountpoint).replace(u'\u00A0', ' '),
                    'size': fs_usage.total,
                    'used': fs_usage.used,
                    'free': fs_usage.free,
                    'percent': fs_usage.percent,
                    'key': self.get_key()}
                stats.append(fs_current)

        elif self.input_method == 'snmp':
            # Update stats using SNMP

            # SNMP bulk command to get all file system in one shot
            try:
                fs_stat = self.get_stats_snmp(snmp_oid=snmp_oid[self.short_system_name],
                                              bulk=True)
            except KeyError:
                fs_stat = self.get_stats_snmp(snmp_oid=snmp_oid['default'],
                                              bulk=True)

            # Loop over fs
            if self.short_system_name in ('windows', 'esxi'):
                # Windows or ESXi tips
                for fs in fs_stat:
                    # Memory stats are grabbed in the same OID table (ignore it)
                    if fs == 'Virtual Memory' or fs == 'Physical Memory' or fs == 'Real Memory':
                        continue
                    size = int(fs_stat[fs]['size']) * int(fs_stat[fs]['alloc_unit'])
                    used = int(fs_stat[fs]['used']) * int(fs_stat[fs]['alloc_unit'])
                    percent = float(used * 100 / size)
                    fs_current = {
                        'device_name': '',
                        'mnt_point': fs.partition(' ')[0],
                        'size': size,
                        'used': used,
                        'percent': percent,
                        'key': self.get_key()}
                    stats.append(fs_current)
            else:
                # Default behavior
                for fs in fs_stat:
                    fs_current = {
                        'device_name': fs_stat[fs]['device_name'],
                        'mnt_point': fs,
                        'size': int(fs_stat[fs]['size']) * 1024,
                        'used': int(fs_stat[fs]['used']) * 1024,
                        'percent': float(fs_stat[fs]['percent']),
                        'key': self.get_key()}
                    stats.append(fs_current)

        # Update the stats
        self.stats = stats

        return self.stats
600473
def refresh(self):
        
        if not self._client:
            return
        current_images = self._client.images()
        self.clear()
        self._update(current_images)
        for image in current_images:
            tags = image.get('RepoTags')
            if tags:
                self.update({tag: image['Id'] for tag in tags})
1346656
def update(self):
        
        vm = self._cs_api.list_virtualmachines(id=self.id)[0]
        self.is_running = self._is_running(vm.state)
899901
def update_metadata(self, scaling_group, metadata):
        
        if not isinstance(scaling_group, ScalingGroup):
            scaling_group = self.get(scaling_group)
        curr_meta = scaling_group.metadata
        curr_meta.update(metadata)
        return self.update(scaling_group, metadata=curr_meta)
1054006
public static void update(Registry registry) {
    Iterator<Map.Entry<Id, Object>> iter = registry.state().entrySet().iterator();
    while (iter.hasNext()) {
      Map.Entry<Id, Object> entry = iter.next();
      if (entry.getValue() instanceof AbstractMeterState) {
        AbstractMeterState tuple = (AbstractMeterState) entry.getValue();
        tuple.doUpdate(registry);
        if (tuple.hasExpired()) {
          iter.remove();
        }
      }
    }
  }
229389
def update_base_image(path: str):
    """"""
    with open(path, 'r') as file_handle:
        contents = file_handle.read()

    regex = re.compile('from\s+(?P<source>[^\s]+)', re.IGNORECASE)
    matches = regex.findall(contents)

    if not matches:
        return None

    match = matches[0]
    os.system('docker pull {}'.format(match))
    return match