예제 #1
0
 def test_returns_site_list_and_arbitrators_list(self):
     self.assertEqual(
         (["1.1.1.1", "2.2.2.2", "3.3.3.3"], ["4.4.4.4", "5.5.5.5"]),
         config_structure.take_peers([
             config_structure.ConfigItem("site", "1.1.1.1"),
             config_structure.ConfigItem("site", "2.2.2.2"),
             config_structure.ConfigItem("site", "3.3.3.3"),
             config_structure.ConfigItem("arbitrator", "4.4.4.4"),
             config_structure.ConfigItem("arbitrator", "5.5.5.5"),
         ], ))
예제 #2
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)
예제 #3
0
 def test_returns_site_list_and_arbitrators_list(self):
     self.assertEqual(
         (
             ["1.1.1.1", "2.2.2.2", "3.3.3.3"],
             ["4.4.4.4", "5.5.5.5"]
         ),
         config_structure.take_peers(
             [
                 config_structure.ConfigItem("site", "1.1.1.1"),
                 config_structure.ConfigItem("site", "2.2.2.2"),
                 config_structure.ConfigItem("site", "3.3.3.3"),
                 config_structure.ConfigItem("arbitrator", "4.4.4.4"),
                 config_structure.ConfigItem("arbitrator", "5.5.5.5"),
             ],
         )
     )
예제 #4
0
파일: booth.py 프로젝트: HideoYamauchi/pcs
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)