本文整理汇总了Python中ambari_agent.AmbariConfig.AmbariConfig.add_section方法的典型用法代码示例。如果您正苦于以下问题:Python AmbariConfig.add_section方法的具体用法?Python AmbariConfig.add_section怎么用?Python AmbariConfig.add_section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ambari_agent.AmbariConfig.AmbariConfig
的用法示例。
在下文中一共展示了AmbariConfig.add_section方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_osdisks_remote
# 需要导入模块: from ambari_agent.AmbariConfig import AmbariConfig [as 别名]
# 或者: from ambari_agent.AmbariConfig.AmbariConfig import add_section [as 别名]
def test_osdisks_remote(self, communicate_mock, popen_mock,
get_os_version_mock, get_os_type_mock):
get_os_type_mock.return_value = "suse"
get_os_version_mock.return_value = "11"
Hardware.osdisks()
popen_mock.assert_called_with(['timeout', '10', "df","-kPT"], stdout=-1)
config = AmbariConfig()
Hardware.osdisks(config)
popen_mock.assert_called_with(['timeout', '10', "df","-kPT"], stdout=-1)
config.add_section(AmbariConfig.AMBARI_PROPERTIES_CATEGORY)
config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_KEY, "true")
Hardware.osdisks(config)
popen_mock.assert_called_with(['timeout', '10', "df","-kPT"], stdout=-1)
config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_KEY, "false")
Hardware.osdisks(config)
popen_mock.assert_called_with(['timeout', '10', "df","-kPT", "-l"], stdout=-1)
config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY, "0")
Hardware.osdisks(config)
popen_mock.assert_called_with(['timeout', '10', "df","-kPT","-l"], stdout=-1)
config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY, "1")
Hardware.osdisks(config)
popen_mock.assert_called_with(["timeout","1","df","-kPT","-l"], stdout=-1)
config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY, "2")
Hardware.osdisks(config)
popen_mock.assert_called_with(["timeout","2","df","-kPT","-l"], stdout=-1)