Update os_version attribute.
503628
def update_os_version(self):
        """"""
        self.chain.connection.log("Detecting os version")
        os_version = self.driver.get_os_version(self.version_text)
        if os_version:
            self.chain.connection.log("SW Version: {}".format(os_version))
            self.os_version = os_version
538713
def _update(self, **kwargs):
        '''
        '''

        legacy = kwargs.pop('legacy', False)
        tmos_ver = self._meta_data['bigip']._meta_data['tmos_version']
        self._filter_version_specific_options(tmos_ver, **kwargs)
        if 'Drafts' not in self._meta_data['uri'] and \
                LooseVersion(tmos_ver) >= LooseVersion('12.1.0') and \
                not legacy:
            msg = 'Update operation not allowed on a published policy.'
            raise OperationNotSupportedOnPublishedPolicy(msg)
        super(Policy, self)._update(**kwargs)
747676
def update(self):
        
        # Init new stats
        stats = self.get_init_value()

        if self.input_method == 'local':
            # Update stats using the standard system lib
            stats['os_name'] = platform.system()
            stats['hostname'] = platform.node()
            stats['platform'] = platform.architecture()[0]
            if stats['os_name'] == "Linux":
                try:
                    linux_distro = platform.linux_distribution()
                except AttributeError:
                    stats['linux_distro'] = _linux_os_release()
                else:
                    if linux_distro[0] == '':
                        stats['linux_distro'] = _linux_os_release()
                    else:
                        stats['linux_distro'] = ' '.join(linux_distro[:2])
                stats['os_version'] = platform.release()
            elif (stats['os_name'].endswith('BSD') or
                  stats['os_name'] == 'SunOS'):
                stats['os_version'] = platform.release()
            elif stats['os_name'] == "Darwin":
                stats['os_version'] = platform.mac_ver()[0]
            elif stats['os_name'] == "Windows":
                os_version = platform.win32_ver()
                stats['os_version'] = ' '.join(os_version[::2])
                # if the python version is 32 bit perhaps the windows operating
                # system is 64bit
                if stats['platform'] == '32bit' and 'PROCESSOR_ARCHITEW6432' in os.environ:
                    stats['platform'] = '64bit'
            else:
                stats['os_version'] = ""
            # Add human readable name
            if stats['os_name'] == "Linux":
                stats['hr_name'] = stats['linux_distro']
            else:
                stats['hr_name'] = '{} {}'.format(
                    stats['os_name'], stats['os_version'])
            stats['hr_name'] += ' {}'.format(stats['platform'])

        elif self.input_method == 'snmp':
            # Update stats using SNMP
            try:
                stats = self.get_stats_snmp(
                    snmp_oid=snmp_oid[self.short_system_name])
            except KeyError:
                stats = self.get_stats_snmp(snmp_oid=snmp_oid['default'])
            # Default behavor: display all the information
            stats['os_name'] = stats['system_name']
            # Windows OS tips
            if self.short_system_name == 'windows':
                for r, v in iteritems(snmp_to_human['windows']):
                    if re.search(r, stats['system_name']):
                        stats['os_name'] = v
                        break
            # Add human readable name
            stats['hr_name'] = stats['os_name']

        # Update the stats
        self.stats = stats

        return self.stats
342813
def upgrade():
    """"""
    current_date = datetime.utcnow()

    # Add 'created' and 'updated' columns to RemoteAccount
    _add_created_updated_columns('oauthclient_remoteaccount', current_date)

    # Add 'created' and 'updated' columns to RemoteToken
    _add_created_updated_columns('oauthclient_remotetoken', current_date)

    # Add 'created' and 'updated' columns to UserIdentity
    _add_created_updated_columns('oauthclient_useridentity', current_date)
592956
def _update_version_data(self, result, info):
        
        name = info.pop('name')
        version = info.pop('version')
        if version in result:
            dist = result[version]
            md = dist.metadata
        else:
            dist = make_dist(name, version, scheme=self.scheme)
            md = dist.metadata
        dist.digest = self._get_digest(info)
        if md.source_url != info['url']:
            md.source_url = self.prefer_url(md.source_url, info['url'])
        dist.locator = self
        result[version] = dist
1264042
def _init_obo_version(self, line):
        """"""
        if line[0:14] == "format-version":
            self.format_version = line[16:-1]
        if line[0:12] == "data-version":
            self.data_version = line[14:-1]
366471
def update_release_version():
    """"""
    version = get_version(pep440=True)
    with open(VERSION_FILE, "w") as outfile:
        outfile.write(version)
        outfile.write("\n")
1374465
def load_version():
    """"""
    filename = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                            "cpt", "__init__.py"))
    with open(filename, "rt") as version_file:
        conan_init = version_file.read()
        version = re.search("__version__ = '([0-9a-z.-]+)'", conan_init).group(1)
        return version
135662
def run_version(args: dict) -> int:
    """"""
    version = environ.package_settings.get('version', 'unknown')
    print('VERSION: {}'.format(version))
    return 0
1105076
def update_system_path():
        """"""
        cwd = os.getcwd()
        lib_dir = os.path.join(os.getcwd(), 'lib_')
        lib_latest = os.path.join(os.getcwd(), 'lib_latest')

        # insert the lib_latest directory into the system Path if no other lib directory found. This
        # entry will be bumped to index 1 after adding the current working directory.
        if not [p for p in sys.path if lib_dir in p]:
            sys.path.insert(0, lib_latest)

        # insert the current working directory into the system Path for the App, ensuring that it is
        # always the first entry in the list.
        try:
            sys.path.remove(cwd)
        except ValueError:
            pass
        sys.path.insert(0, cwd)
764164
def do_upgrade():
    """"""
    op.alter_column(
        table_name='knwKBRVAL',
        column_name='id_knwKB',
        type_=db.MediumInteger(8, unsigned=True),
        existing_nullable=False,
        existing_server_default='0'
    )
446710
def set_version(old_version, new_version):
        
        try:
            if APISettings.DEBUG:
                Shell.debug('* ' + old_version + ' --> ' + new_version)
                return True

            for line in fileinput.input(os.path.abspath(APISettings.VERSION_FILE), inplace=True):
                print(line.replace(old_version, new_version), end='')
            Shell.success('* ' + old_version + ' --> ' + new_version)
        except FileNotFoundError:
            Shell.warn('File not found!')
44482
def update_family(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinAdminSession.update_bin
        # OSID spec does not require returning updated catalog
        return Family(
            self._provider_manager,
            self._get_provider_session('family_admin_session').update_family(*args, **kwargs),
            self._runtime,
            self._proxy)
477957
def os_version(self, value):
        
        if value == self._defaults['ai.device.osVersion'] and 'ai.device.osVersion' in self._values:
            del self._values['ai.device.osVersion']
        else:
            self._values['ai.device.osVersion'] = value
1070842
def set_version(self, version='0.0.0', save=True):
        """"""
        self.set(self.DEFAULT_SECTION_NAME, 'version', version, save=save)
772005
def do_version():
    """"""
    v = ApiPool.ping.model.Version(
        name=ApiPool().current_server_name,
        version=ApiPool().current_server_api.get_version(),
        container=get_container_version(),
    )
    log.info("/version: " + pprint.pformat(v))
    return v
975712
def update_version(self, service_id, version_number, **kwargs):
		""""""
		body = self._formdata(kwargs, FastlyVersion.FIELDS)
		content = self._fetch("/service/%s/version/%d/" % (service_id, version_number), method="PUT", body=body)
		return FastlyVersion(self, content)