[Update] 修改运行命令名称 (#2140)

This commit is contained in:
老广
2018-12-11 11:09:46 +08:00
committed by GitHub
parent 76aadad6fe
commit 31356e825f
6 changed files with 20 additions and 6 deletions

View File

@@ -159,7 +159,7 @@ class CommandResultCallback(AdHocResultCallback):
def v2_playbook_on_play_start(self, play):
now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
msg = '$ {} ({})'.format('echo', now)
msg = '$ {} ({})'.format(play.name, now)
self._play = play
self._display.banner(msg)

View File

@@ -250,7 +250,5 @@ class CommandRunner(AdHocRunner):
tasks = [
{"action": {"module": module, "args": cmd}}
]
hosts = self.inventory.get_hosts(pattern=pattern)
name = "Run command {} on {}'s hosts".format(cmd, len(hosts))
return self.run(tasks, pattern, play_name=name)
return self.run(tasks, pattern, play_name=cmd)