示例#1
0
 def test_add_authfile(self):
     self.assertEqual([
         config_structure.ConfigItem("authfile", "/path/to/auth.file"),
         config_structure.ConfigItem("site", "1.1.1.1"),
     ],
                      config_structure.set_authfile([
                          config_structure.ConfigItem("site", "1.1.1.1"),
                      ], "/path/to/auth.file"))
示例#2
0
 def test_add_authfile(self):
     self.assertEqual(
         [
             config_structure.ConfigItem("authfile", "/path/to/auth.file"),
             config_structure.ConfigItem("site", "1.1.1.1"),
         ],
         config_structure.set_authfile(
             [
                 config_structure.ConfigItem("site", "1.1.1.1"),
             ],
             "/path/to/auth.file"
         )
     )
示例#3
0
def config_setup(env, booth_configuration, overwrite_existing=False):
    """
    create boot configuration
    list site_list contains site adresses of multisite
    list arbitrator_list contains arbitrator adresses of multisite
    """

    config_content = config_exchange.from_exchange_format(booth_configuration)
    config_structure.validate_peers(
        *config_structure.take_peers(config_content))

    env.booth.create_key(config_files.generate_key(), overwrite_existing)
    config_content = config_structure.set_authfile(config_content,
                                                   env.booth.key_path)
    env.booth.create_config(build(config_content), overwrite_existing)
示例#4
0
def config_setup(env, booth_configuration, overwrite_existing=False):
    """
    create boot configuration
    list site_list contains site adresses of multisite
    list arbitrator_list contains arbitrator adresses of multisite
    """

    config_content = config_exchange.from_exchange_format(booth_configuration)
    config_structure.validate_peers(
        *config_structure.take_peers(config_content)
    )

    env.booth.create_key(config_files.generate_key(), overwrite_existing)
    config_content = config_structure.set_authfile(
        config_content,
        env.booth.key_path
    )
    env.booth.create_config(build(config_content), overwrite_existing)