本文整理汇总了Python中lib.remote.remote_util.RemoteMachineShellConnection.execute_non_sudo_command方法的典型用法代码示例。如果您正苦于以下问题:Python RemoteMachineShellConnection.execute_non_sudo_command方法的具体用法?Python RemoteMachineShellConnection.execute_non_sudo_command怎么用?Python RemoteMachineShellConnection.execute_non_sudo_command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lib.remote.remote_util.RemoteMachineShellConnection
的用法示例。
在下文中一共展示了RemoteMachineShellConnection.execute_non_sudo_command方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_if_eventing_consumers_are_cleaned_up
# 需要导入模块: from lib.remote.remote_util import RemoteMachineShellConnection [as 别名]
# 或者: from lib.remote.remote_util.RemoteMachineShellConnection import execute_non_sudo_command [as 别名]
def check_if_eventing_consumers_are_cleaned_up(self):
eventing_nodes = self.get_nodes_from_services_map(service_type="eventing", get_all_nodes=True)
array_of_counts = []
command = "ps -ef | grep eventing-consumer | grep -v grep | wc -l"
for eventing_node in eventing_nodes:
shell = RemoteMachineShellConnection(eventing_node)
count, error = shell.execute_non_sudo_command(command)
if isinstance(count, list):
count = int(count[0])
else:
count = int(count)
log.info("Node : {0} , eventing_consumer processes running : {1}".format(eventing_node.ip, count))
array_of_counts.append(count)
count_of_all_eventing_consumers = sum(array_of_counts)
if count_of_all_eventing_consumers != 0:
return False
return True