mirror of https://github.com/apache/cloudstack.git
systemvm: fix proc.find in CsProcess.py (#4413)
Co-authored-by: Wei Zhou <w.zhou@global.leaseweb.com>
This commit is contained in:
parent
15954fefee
commit
ff8a84ee77
|
|
@ -17,7 +17,6 @@
|
|||
# under the License.
|
||||
import os
|
||||
from CsFile import CsFile
|
||||
from CsProcess import CsProcess
|
||||
import CsHelper
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ class CsProcess(object):
|
|||
|
||||
def find_pid(self):
|
||||
self.pid = []
|
||||
items = len(self.search)
|
||||
for i in CsHelper.execute("ps aux"):
|
||||
items = len(self.search)
|
||||
proc = re.split(r"\s+", i)[items*-1:]
|
||||
proc = re.split(r"\s+", i)[10:]
|
||||
matches = len([m for m in proc if m in self.search])
|
||||
if matches == items:
|
||||
self.pid.append(re.split(r"\s+", i)[1])
|
||||
|
|
|
|||
Loading…
Reference in New Issue