This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch 4.14
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.14 by this push:
new ff8a84e systemvm: fix proc.find in CsProcess.py (#4413)
ff8a84e is described below
commit ff8a84ee77f4f668cb9c8c5a3978f6fb4fb0867e
Author: Wei Zhou <[email protected]>
AuthorDate: Wed Oct 21 20:21:54 2020 +0300
systemvm: fix proc.find in CsProcess.py (#4413)
Co-authored-by: Wei Zhou <[email protected]>
---
systemvm/debian/opt/cloud/bin/cs/CsApp.py | 1 -
systemvm/debian/opt/cloud/bin/cs/CsProcess.py | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/systemvm/debian/opt/cloud/bin/cs/CsApp.py
b/systemvm/debian/opt/cloud/bin/cs/CsApp.py
index 9f3375f..a2292ae 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsApp.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsApp.py
@@ -17,7 +17,6 @@
# under the License.
import os
from CsFile import CsFile
-from CsProcess import CsProcess
import CsHelper
diff --git a/systemvm/debian/opt/cloud/bin/cs/CsProcess.py
b/systemvm/debian/opt/cloud/bin/cs/CsProcess.py
index c3a42e5..4a64807 100755
--- a/systemvm/debian/opt/cloud/bin/cs/CsProcess.py
+++ b/systemvm/debian/opt/cloud/bin/cs/CsProcess.py
@@ -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])