Exemplo n.º 1
0
 def clients_dir(sample_path=None):
     # pylint: disable=E0602
     """Getting suggestion for clients_dir."""
     suggestion = __class__.get_value_from_sample(_helper.current_method(),
                                                  sample_path)
     if suggestion is None:
         suggestion = _helper.sanitize_path(
             os.path.expanduser('~')) + 'openvpn-clients'
     return suggestion
Exemplo n.º 2
0
 def hostname(sample_path=None):
     # pylint: disable=E0602
     """Returns suggestion for hostname."""
     suggestion = __class__.get_value_from_sample(_helper.current_method(),
                                                  sample_path)
     if suggestion is None:
         suggestion = _helper.fetch_hostname_by_system()
     if suggestion is None:
         suggestion = _helper.fetch_hostname_by_reverse_dns()
     return suggestion
Exemplo n.º 3
0
 def sovpn_share_salt(sample_path=None):
     # pylint: disable=E0602
     """Getting suggestion for sovpn_share_salt."""
     suggestion = __class__.get_value_from_sample(_helper.current_method(),
                                                  sample_path)
     if suggestion is None:
         chars = string.ascii_letters + string.digits
         length = random.randint(10, 16)
         suggestion = ''.join(random.choice(chars) for _ in range(length))
     return suggestion
Exemplo n.º 4
0
    def mgmt_used(sample_path=None):
        # pylint: disable=E0602
        """Getting suggestion for mgmt_used."""
        suggestion = __class__.get_value_from_sample(_helper.current_method(),
                                                     sample_path)
        if suggestion is True:
            suggestion = 'Y'
        elif suggestion is False:
            suggestion = 'N'

        return suggestion
Exemplo n.º 5
0
 def port(sample_path=None):
     # pylint: disable=E0602
     """Getting suggestion for port."""
     suggestion = __class__.get_value_from_sample(_helper.current_method(),
                                                  sample_path)
     return suggestion
Exemplo n.º 6
0
 def sovpn_share_address(sample_path=None):
     # pylint: disable=E0602
     """Getting suggestion for sovpn_share_address."""
     suggestion = __class__.get_value_from_sample(_helper.current_method(),
                                                  sample_path)
     return suggestion