Exemplo n.º 1
0
 def _find_default_http_proxy(self, values):
     """ Finds the global proxy name and returns updated values accordingly."""
     proxy = SettingsEntity(self.browser)
     result = proxy.read(property_name='name = content_default_http_proxy'
                         )['table'][0]['Value']
     global_proxy_name = result.split()[0]
     if global_proxy_name == 'no':
         global_proxy_name = 'None'
     values[
         "repo_content.http_proxy_policy"] = f'Global Default ({global_proxy_name})'
     return values
Exemplo n.º 2
0
    def global_default_http_proxy(self):
        """Look up the default http proxy and return the string that a user would select for
        HTTP Proxy Policy when creating or updating a repository.
        """
        proxy_name = SettingsEntity(self.browser).read(
            property_name='name = content_default_http_proxy'
        )['table'][0]['Value']

        # The default text for no default http proxy varies between versions of Satellite
        if proxy_name in ('Empty', 'no global default'):
            proxy_name = 'None'

        return f'Global Default ({proxy_name})'
Exemplo n.º 3
0
    def global_default_http_proxy(self):
        """Look up the default http proxy and return the string that a user would select for
        HTTP Proxy Policy when creating or updating a repository.
        """
        proxy_setting = SettingsEntity(self.browser).read(
            property_name='name = content_default_http_proxy'
        )['table'][0]['Value']

        # The default text for no default http proxy varies between versions of Satellite
        if proxy_setting in ('Empty', 'no global default'):
            proxy_name = 'None'
        else:
            regex = re.compile(r'^(.*) \((.*)\)$')
            match = regex.match(proxy_setting)
            proxy_name = match.group(1) if match else 'None'

        return f'Global Default ({proxy_name})'
Exemplo n.º 4
0
 def settings(self):
     """Instance of Settings entity."""
     return SettingsEntity(self.browser)