Skip to content

Commit 4af67b0

Browse files
author
Tim Smith
committed
CP-54766 Remove internal path manipulation referencing /opt
Signed-off-by: Tim Smith <[email protected]>
1 parent 16ff117 commit 4af67b0

File tree

11 files changed

+4
-21
lines changed

11 files changed

+4
-21
lines changed

libs/sm/on_slave.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
# along with this program; if not, write to the Free Software Foundation, Inc.,
1414
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1515

16-
import sys
17-
sys.path.append("/opt/xensource/sm/")
1816
from sm.core import util
1917
from sm.core import lock
2018
from sm.lvmcache import LVMCache

scripts/make-dummy-sr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
if [ -d /sys/class/iscsi_session ] ; then
55
for dir in /sys/class/iscsi_session/* ; do
66
if [ -d "$dir" ] ; then
7-
# Ensure that the SR backend /opt/xensource/sm does not deactivate
7+
# Ensure that the SR backend does not deactivate
88
# this iSCSI session by saying it is in use by a "dummy" SR
99
iqn="$(cat $dir/targetname)"
1010
dummy_sr="00000000-0000-0000-0000-000000000000"

scripts/plugins/coalesce-leaf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import sys
2222
import XenAPIPlugin
2323
from functools import reduce
2424

25-
sys.path.append("/opt/xensource/sm/")
26-
sys.path.insert(0, "/opt/xensource/sm")
2725
import getopt
2826
import XenAPI
2927
from sm import cleanup

scripts/plugins/intellicache-clean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import sys
2121
import XenAPIPlugin
22-
sys.path.append("/opt/xensource/sm/")
2322
from sm.core import util
2423
from sm import cleanup
2524

scripts/plugins/lvhd-thin

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import sys
2222
import XenAPIPlugin
23-
sys.path.append("/opt/xensource/sm/")
2423
from sm.core import util
2524
from sm import lvhdutil
2625
from sm.lvmcache import LVMCache

scripts/plugins/nfs-on-slave

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#
1818
# A plugin for synchronizing slaves when something changes on the Master
1919

20-
import sys; sys.path.append("/opt/xensource/sm/")
2120
from sm.core import util
2221
import os, glob, errno
2322

scripts/plugins/tapdisk-pause

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@
1818
# Pause/unpause tapdisk on the local host
1919

2020
import os
21-
import sys
2221
import XenAPIPlugin
2322
import XenAPI
2423

25-
sys.path.append("/opt/xensource/sm/")
2624
from sm import blktap2
2725
from sm.core import util
2826
from sm.core.lock import Lock
@@ -163,7 +161,7 @@ class Tapdisk:
163161
continue
164162
lvm_cache.activate(ns, uuid, lv_name, False)
165163

166-
import VDI
164+
from sm import VDI
167165
vdi = VDI.VDI.from_uuid(self.session, self.vdi_uuid)
168166
# Check if CBT is enabled on disk we are about to unpause
169167
if vdi._get_blocktracking_status():

scripts/plugins/trim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
# A plugin for enabling trim on LVM based SRs to free up storage space
1919
# in Storage arrays.
2020

21-
import sys
2221
import XenAPIPlugin
22+
from sm import trim_util
2323

2424
if __name__ == "__main__":
25-
sys.path.append("/opt/xensource/sm/")
26-
from sm import trim_util
2725
XenAPIPlugin.dispatch({"do_trim": trim_util.do_trim})

utils/blktap2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
# You should have received a copy of the GNU Lesser General Public License
1515
# along with this program; if not, write to the Free Software Foundation, Inc.,
1616
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17-
import sys
18-
sys.path.append("/opt/xensource/sm/")
1917
import os
18+
import sys
2019
import json
2120

2221
from sm.core import util

utils/cleanup

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import getopt
2222
import sys
2323

24-
sys.path.append("/opt/xensource/sm/")
2524
from sm import cleanup
2625

2726

utils/sr_health_check

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
Health check for SR, to be triggered periodically by a systemd timer. What is checked is
2020
SR implementation type dependent.
2121
"""
22-
# This path adjustment can be removed eventually
23-
import sys
24-
sys.path.append("/opt/xensource/sm/")
25-
2622
from sm import sr_health_check
2723

2824
if __name__ == "__main__":

0 commit comments

Comments
 (0)