Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Update to fc with gcc7 fix - v1.6.x #7225

Merged
merged 3 commits into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libraries/fc
12 changes: 9 additions & 3 deletions tests/testUtils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
import errno
import subprocess
import time
Expand Down Expand Up @@ -217,12 +218,17 @@ def arePortsAvailable(ports):

@staticmethod
def pgrepCmd(serverName):
pgrepOpts="-fl"
# pylint: disable=deprecated-method
if platform.linux_distribution()[0] in ["Ubuntu", "LinuxMint", "Fedora","CentOS Linux","arch"]:
# pgrep differs on different platform (amazonlinux1 and 2 for example). We need to check if pgrep -h has -a available and add that if so:
try:
pgrepHelp = re.search('-a', subprocess.Popen("pgrep --help 2>/dev/null", shell=True, stdout=subprocess.PIPE).stdout.read().decode('utf-8'))
pgrepHelp.group(0) # group() errors if -a is not found, so we don't need to do anything else special here.
pgrepOpts="-a"
except AttributeError as error:
# If no -a, AttributeError: 'NoneType' object has no attribute 'group'
pgrepOpts="-fl"

return "pgrep %s %s" % (pgrepOpts, serverName)
return "pgrep %s %s" % (pgrepOpts, serverName)\

@staticmethod
def getBlockLog(blockLogLocation, silentErrors=False, exitOnError=False):
Expand Down