本文整理汇总了Python中bootstrap.Bootstrap.getRunSetupCommand方法的典型用法代码示例。如果您正苦于以下问题:Python Bootstrap.getRunSetupCommand方法的具体用法?Python Bootstrap.getRunSetupCommand怎么用?Python Bootstrap.getRunSetupCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bootstrap.Bootstrap
的用法示例。
在下文中一共展示了Bootstrap.getRunSetupCommand方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_getRunSetupCommand
# 需要导入模块: from bootstrap import Bootstrap [as 别名]
# 或者: from bootstrap.Bootstrap import getRunSetupCommand [as 别名]
def test_getRunSetupCommand(self, getRunSetupWithoutPasswordCommand_mock,
getRunSetupWithPasswordCommand_mock,
hasPassword_mock):
shared_state = SharedState("root", "sshkey_file", "scriptDir", "bootdir",
"setupAgentFile", "ambariServer", "centos6",
None, "8440", "root")
bootstrap_obj = Bootstrap("hostname", shared_state)
# With password
hasPassword_mock.return_value = True
getRunSetupWithPasswordCommand_mock.return_value = "RunSetupWithPasswordCommand"
getRunSetupWithoutPasswordCommand_mock.return_value = "RunSetupWithoutPasswordCommand"
res = bootstrap_obj.getRunSetupCommand("dummy-host")
self.assertEqual(res, "RunSetupWithPasswordCommand")
# Without password
hasPassword_mock.return_value = False
res = bootstrap_obj.getRunSetupCommand("dummy-host")
self.assertEqual(res, "RunSetupWithoutPasswordCommand")
示例2: test_agent_setup_command_without_project_version
# 需要导入模块: from bootstrap import Bootstrap [as 别名]
# 或者: from bootstrap.Bootstrap import getRunSetupCommand [as 别名]
def test_agent_setup_command_without_project_version(self):
os.environ[AMBARI_PASSPHRASE_VAR_NAME] = ""
version = None
shared_state = SharedState("root", "sshkey_file", "scriptDir", "bootdir",
"setupAgentFile", "ambariServer", "centos6",
version, "8440", "root")
bootstrap_obj = Bootstrap("hostname", shared_state)
runSetupCommand = bootstrap_obj.getRunSetupCommand("hostname")
self.assertTrue(runSetupCommand.endswith(" 8440"))