Exemplo n.º 1
0
 def config_path(self):
     import os
     cls = self.__class__
     configfile_names = list(
         generate_configfile_names(cls.config_files, cls.config_searchpath))
     config_param = Param(type=click.File("r"))
     config_file = config_param.parse(configfile_names[0])
     return os.path.realpath(config_file.name)
Exemplo n.º 2
0
 class VCenterCategory(SectionSchema):
     type = Param(type=str)
     name = Param(type=str)
     name_format = Param(type=str)
     hostname_format = Param(type=str)
     datastore = Param(type=str)
     datastore_cluster = Param(type=str)
     network = Param(type=str)
     compute = Param(type=str)
     template = Param(type=str)
     folder = Param(type=str)
Exemplo n.º 3
0
 class Vcenter(SectionSchema):
     host = Param(type=str)
     port = Param(type=int)
     user = Param(type=str)
     pwd = Param(type=str)
     ssl = Param(type=bool)
     datacenter = Param(type=str)
     log = Param(type=click.Path())
     log_format = Param(type=str)
     zfill = Param(type=bool)
Exemplo n.º 4
0
    def config_path(self):
        import os
        cls = self.__class__
        config_param = Param(type=click.File('r'))
        configfile_names = list(
            generate_configfile_names(cls.config_files, cls.config_searchpath))

        if configfile_names:
            for name in configfile_names:
                config_file = config_param.parse(name)
                path = os.path.realpath(config_file.name)
        else:
            path = os.getcwd()
        return path
Exemplo n.º 5
0
    class Memote(SectionSchema):
        """Describes the memote configuration keys and values."""

        collect = Param(type=bool, default=True)
        git = Param(type=bool, default=True)
        addargs = Param(type=str, default="")
        model = Param(type=click.Path(exists=True, dir_okay=False))
        directory = Param(
            type=click.Path(exists=True, file_okay=False, writable=True))
        github_repository = Param(type=str)
        github_username = Param(type=str)
        exclusive = Param(type=str, multiple=True)
        skip = Param(type=str, multiple=True)
        solver = Param(type=click.Choice(["cplex", "glpk", "gurobi"]),
                       default="glpk")
Exemplo n.º 6
0
 class Options(SectionSchema):
     interval = Param(type=click.IntRange(1, 300))
     iterations = Param(type=int)
     retries = Param(type=bool)
     channel = Param(type=bool)
     ap_name = Param(type=bool)
     rx_packets = Param(type=bool)
     tx_packets = Param(type=bool)
     ping = Param(type=bool)
Exemplo n.º 7
0
 class Database(SectionSchema):
     db_name = Param(type=str)
     db_table = Param(type=str)
     db_address = Param(type=str)
     db_port = Param(type=str)
     db_user = Param(type=str)
     db_pass = Param(type=str)
     silent = Param(type=bool)
Exemplo n.º 8
0
 class General(SectionSchema):
     rsync_args = Param(type=str, default='-rlptDv')
     ignore_directories = Param(type=str, multiple=True, default=[])
     fail_if_parse_error = Param(type=bool, default=False)
     check_mountpoints = Param(type=bool, default=True)
     threads = Param(type=int, default=4)
     log_to_es = Param(type=bool, default=False)
Exemplo n.º 9
0
    class Memote(SectionSchema):
        """Describes the memote configuration keys and values."""

        collect = Param(type=bool, default=True)
        git = Param(type=bool, default=True)
        addargs = Param(type=str, default="")
        model = Param(type=click.Path(exists=True, dir_okay=False))
        directory = Param(
            type=click.Path(exists=True, file_okay=False, writable=True))
        github_repository = Param(type=str)
        github_username = Param(type=str)
Exemplo n.º 10
0
 def test_ctor__without_help_attribute(self):
     param = Param()
     assert param.help is None
Exemplo n.º 11
0
 def test_ctor__with_help_attribute(self):
     param = Param(help="Hello")
     assert param.help == "Hello"
Exemplo n.º 12
0
 def test_ctor__without_type_attribute_has_string_type(self):
     param = Param()
     assert isinstance(param.type, click.types.StringParamType)
Exemplo n.º 13
0
 class DNSZoneAvailable(SectionSchema):
     available = Param(type=str, multiple=True)
Exemplo n.º 14
0
 class Ubus(SectionSchema):
     host = Param(type=str)
     username = Param(type=str)
     password = Param(type=str)
Exemplo n.º 15
0
 class PygglCF(SectionSchema):
     period_per_day = Param(type=str)
Exemplo n.º 16
0
 class DevProperties(SectionSchema):
     vsdk_root = Param(type=str)
Exemplo n.º 17
0
 class General(SectionSchema):
     wlc_address = Param(type=str)
     client_address = Param(type=str)
Exemplo n.º 18
0
 class Hello(SectionSchema):
     name = Param(type=str)
Exemplo n.º 19
0
 class HelloMore(SectionSchema):
     numbers = Param(type=int, multiple=True)
Exemplo n.º 20
0
 class Hello(SectionSchema):
     name = Param(type=str)
     number = Param(type=int)
Exemplo n.º 21
0
 class Defaults(SectionSchema):
     config_version = Param(type=str)
Exemplo n.º 22
0
 class DNSZoneItems(SectionSchema):
     name = Param(type=str)
     server = Param(type=str)
     keyring_name = Param(type=str)
     keyring_value = Param(type=str)
Exemplo n.º 23
0
    class Default(SectionSchema):
        """Default configuration schema."""

        api_key = Param(type=str)
Exemplo n.º 24
0
 class SNMP(SectionSchema):
     snmp_version = Param(type=click.Choice(['2c', '3']), default="2c")
     snmp_community = Param(type=str)
     snmp_user = Param(type=str)
     snmp_password = Param(type=str)
     snmp_encryption = Param(type=str)
Exemplo n.º 25
0
    class Default(SectionSchema):
        """Default configuration schema."""

        api_host = Param(type=str)
        api_proxy = Param(type=str)
        api_user_agent = Param(type=str)
Exemplo n.º 26
0
 class SwarmCluster(SectionSchema):
     managers = Param(type=int)
     workers = Param(type=int)
Exemplo n.º 27
0
 class TogglCF(SectionSchema):
     User = Param(type=str)
     Email = Param(type=str)
     Project = Param(type=str)
     Tags = Param(type=str)
     Description = Param(type=str)
Exemplo n.º 28
0
 class Default(SectionSchema):
     rssi_off = Param(type=bool)
     snr_off = Param(type=bool)
     data_rate_off = Param(type=bool)
Exemplo n.º 29
0
 class DvpProperties(SectionSchema):
     engine = Param(type=str)
     user = Param(type=str)
     password = Param(type=str)
Exemplo n.º 30
0
 class DNS(SectionSchema):
     rtype = Param(type=str)
     ttl = Param(type=str)