Blame dmlite-LCGDM-2955-skip-dpm2.patch
|
Petr Vokac |
238799e |
diff --git a/shell/src/interpreter.py b/shell/src/interpreter.py
|
|
Petr Vokac |
238799e |
index d18f918b..8a2d79f7 100644
|
|
Petr Vokac |
238799e |
--- a/shell/src/interpreter.py
|
|
Petr Vokac |
238799e |
+++ b/shell/src/interpreter.py
|
|
Petr Vokac |
238799e |
@@ -2549,6 +2549,22 @@ class Util(object):
|
|
Petr Vokac |
238799e |
|
|
Petr Vokac |
238799e |
return adminUserName
|
|
Petr Vokac |
238799e |
|
|
Petr Vokac |
238799e |
+ @staticmethod
|
|
Petr Vokac |
238799e |
+ def getlisteningports():
|
|
Petr Vokac |
238799e |
+ """Check which ports are being listened on"""
|
|
Petr Vokac |
238799e |
+ ports = []
|
|
Petr Vokac |
238799e |
+ try:
|
|
Petr Vokac |
238799e |
+ import subprocess
|
|
Petr Vokac |
238799e |
+ pipe_out_err = subprocess.Popen("ss -tln", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
|
|
Petr Vokac |
238799e |
+ for listen in pipe_out_err[0].split('\n'):
|
|
Petr Vokac |
238799e |
+ m = re.search(r":([0-9]+)\s", listen)
|
|
Petr Vokac |
238799e |
+ if m != None:
|
|
Petr Vokac |
238799e |
+ ports.append(int(m.group(1)))
|
|
Petr Vokac |
238799e |
+ except:
|
|
Petr Vokac |
238799e |
+ pass
|
|
Petr Vokac |
238799e |
+
|
|
Petr Vokac |
238799e |
+ return ports
|
|
Petr Vokac |
238799e |
+
|
|
Petr Vokac |
238799e |
@staticmethod
|
|
Petr Vokac |
238799e |
def setFSReadonly(interpreter, sourceFS):
|
|
Petr Vokac |
238799e |
#check which implementations are loaded
|
|
Petr Vokac |
238799e |
@@ -2572,7 +2588,7 @@ class Util(object):
|
|
Petr Vokac |
238799e |
return 1
|
|
Petr Vokac |
238799e |
else:
|
|
Petr Vokac |
238799e |
#if DPM python is there try to set to RO also via DPM but don't fail in case of errors
|
|
Petr Vokac |
238799e |
- if 'dpm2' in sys.modules:
|
|
Petr Vokac |
238799e |
+ if 'dpm2' in sys.modules and 5015 in Util.getlisteningports():
|
|
Petr Vokac |
238799e |
dpm2.dpm_modifyfs(sourceFS.server, sourceFS.name, 2, sourceFS.weight)
|
|
Petr Vokac |
238799e |
return 0
|
|
Petr Vokac |
238799e |
|