Method to initialize the Volume Service from the config data

        Args:
            version (string): Version of Boss API to use.

        Returns:
            None

        Raises:
            (KeyError): if given invalid version.
8832
def _init_volume_service(self, version):
        
        volume_cfg = self._load_config_section(CONFIG_VOLUME_SECTION)
        self._token_volume = volume_cfg[CONFIG_TOKEN]
        proto = volume_cfg[CONFIG_PROTOCOL]
        host = volume_cfg[CONFIG_HOST]

        self._volume = VolumeService(host, version)
        self._volume.base_protocol = proto
        self._volume.set_auth(self._token_volume)
1371836
def appliance_api_version
      options = { 'Content-Type' => :none, 'X-API-Version' => :none, 'auth' => :none }
      response = rest_api(:get, '/rest/version', options)
      version = response_handler(response)['currentVersion']
      raise ConnectionError, "Couldn't get API version" unless version
      version = version.to_i if version.class != Integer
      version
    rescue ConnectionError
      @logger.warn "Failed to get OneView max api version. Using default (#{OneviewSDK::DEFAULT_API_VERSION})"
      OneviewSDK::DEFAULT_API_VERSION
    end
750326
def get_version(root):
    
    version_json = os.path.join(root, 'version.json')
    if os.path.exists(version_json):
        with open(version_json, 'r') as version_json_file:
            return json.load(version_json_file)
    return None
205446
def get_bucket_versioning_config(self, bucket):
        
        details = self._details(
            method=b"GET",
            url_context=self._url_context(bucket=bucket, object_name="?versioning"),
        )
        d = self._submit(self._query_factory(details))
        d.addCallback(self._parse_versioning_config)
        return d
1107874
def get_init_container(self,
                           init_command,
                           init_args,
                           env_vars,
                           context_mounts,
                           persistence_outputs,
                           persistence_data):
        """"""
        env_vars = to_list(env_vars, check_none=True)
        volume_mounts = to_list(context_mounts, check_none=True)
        init_command = init_command or ["/bin/sh", "-c"]
        init_args = to_list(get_auth_context_args(entity='notebook', entity_name=self.job_name))
        return client.V1Container(
            name=self.init_container_name,
            image=self.init_docker_image,
            image_pull_policy=self.init_docker_image_pull_policy,
            command=init_command,
            args=init_args,
            env=env_vars,
            volume_mounts=volume_mounts)
479729
def get_version(self, version_id=None):
        
        return ObjectVersion.get(bucket=self.obj.bucket, key=self.obj.key,
                                 version_id=version_id)
202885
def _resolve_version(version):
    
    if version is not LATEST:
        return version

    resp = urlopen('https://pypi.python.org/pypi/setuptools/json')
    with contextlib.closing(resp):
        try:
            charset = resp.info().get_content_charset()
        except Exception:
            # Python 2 compat; assume UTF-8
            charset = 'UTF-8'
        reader = codecs.getreader(charset)
        doc = json.load(reader(resp))

    return str(doc['info']['version'])
746376
def update(self, volume, display_name=None, display_description=None):
        
        return volume.update(display_name=display_name,
                display_description=display_description)
175290
def start_import(self, version_id=None):
        
        if not version_id:
            version_id = self.version.id

        target_url = self._client.get_url('VERSION', 'POST', 'import', {'layer_id': self.id, 'version_id': version_id})
        r = self._client.request('POST', target_url, json={})
        return self._deserialize(r.json(), self._manager)
282599
def version(self, version_str: str) -> None:
        
        ver = []
        for i in version_str.split('.'):
            ver.append(int(i))
            self.filter_negatives(int(i))
        self._major, self._minor, self._patch = ver[0], ver[1], ver[2]
478300
def _check_version(self, config):
        
        try:
            self.file_version = config.get(
                escape_for_ini('keyring-setting'),
                escape_for_ini('version'),
            )
        except (configparser.NoSectionError, configparser.NoOptionError):
            return False
        return True
209319
def get_init_container(self,
                           init_command,
                           init_args,
                           env_vars,
                           context_mounts,
                           persistence_outputs,
                           persistence_data):
        """"""
        env_vars = to_list(env_vars, check_none=True)
        env_vars += [
            get_env_var(name=constants.CONFIG_MAP_JOB_INFO_KEY_NAME,
                        value=json.dumps(self.labels)),
        ]
        return client.V1Container(
            name=self.init_container_name,
            image=self.init_docker_image,
            image_pull_policy=self.init_docker_image_pull_policy,
            command=init_command,
            env=env_vars,
            args=init_args,
            volume_mounts=context_mounts)
810503
def init_volumes(self, single=None, only_mount=None, skip_mount=None, swallow_exceptions=True):
        """"""

        for disk in self.disks:
            logger.info("Mounting volumes in {0}".format(disk))
            for volume in disk.init_volumes(single, only_mount, skip_mount, swallow_exceptions=swallow_exceptions):
                yield volume
477211
def within(self, version):
        
        if not isinstance(version, Version):
            version = type(self._min_ver)(self._req, version)
        return version >= self
1233015
def check_api_version(resource_root, min_version):
  
  if resource_root.version < min_version:
    raise Exception("API version %s is required but %s is in use."
        % (min_version, resource_root.version))
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]
986451
def set_version(new_version_number=None, old_version_number=''):
    
    if new_version_number is None:
        return ValueError

    import fileinput
    import sys

    file = join('timezonefinder', '__init__.py')

    for line in fileinput.input(file, inplace=1):
        if old_version_number in line:
            line = line.replace(old_version_number, new_version_number)
        sys.stdout.write(line)