You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2020/10/21 17:22:12 UTC
[cloudstack] branch 4.14 updated: systemvm: fix proc.find in
CsProcess.py (#4413)
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 <57...@users.noreply.github.com>
AuthorDate: Wed Oct 21 20:21:54 2020 +0300
systemvm: fix proc.find in CsProcess.py (#4413)
Co-authored-by: Wei Zhou <w....@global.leaseweb.com>
---
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])