Skip to content

Commit 5c67f16

Browse files
author
Deli Zhang
committed
CA-329871: Remove usage of xslib.py of sm
Signed-off-by: Deli Zhang <[email protected]>
1 parent 0820962 commit 5c67f16

File tree

5 files changed

+18
-22
lines changed

5 files changed

+18
-22
lines changed

src/XenCert/blockunblockhbapaths-brocade

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717

1818
import sys
1919
sys.path.insert(0, "/opt/xensource/sm")
20-
sys.path.insert(0, "/opt/xensource/sm/snapwatchd")
2120
import util
22-
import xslib
21+
import xen.lowlevel.xs
2322
import random
2423
import os
2524
from XenCertLog import XenCertPrint
@@ -70,8 +69,8 @@ for port in sampled_portlist:
7069
elif op == 'unblock':
7170
blockUnblockPort(False, ip, username, password, port)
7271

73-
xs_handle = xslib.get_xs_handle()
74-
xslib.setval(xs_handle, '/xencert/block-unblock-over', '1')
72+
xs_handle = xen.lowlevel.xs.xs()
73+
xs_handle.write('', '/xencert/block-unblock-over', '1')
7574
del xs_handle
7675

7776
if op == 'block':

src/XenCert/blockunblockhbapaths-cisco

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
#
1818
import sys
1919
sys.path.insert(0, "/opt/xensource/sm")
20-
sys.path.insert(0, "/opt/xensource/sm/snapwatchd")
2120
import util
22-
import xslib
21+
import xen.lowlevel.xs
2322
import random
2423
import os
2524
from XenCertLog import XenCertPrint
@@ -70,8 +69,8 @@ for port in sampled_portlist:
7069
elif op == 'unblock':
7170
blockUnblockPort(False, ip, username, password, port)
7271

73-
xs_handle = xslib.get_xs_handle()
74-
xslib.setval(xs_handle, '/xencert/block-unblock-over', '1')
72+
xs_handle = xen.lowlevel.xs.xs()
73+
xs_handle.write('', '/xencert/block-unblock-over', '1')
7574
del xs_handle
7675

7776
if op == 'block':

src/XenCert/blockunblockhbapaths-qlogic

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
#
1818
import sys
1919
sys.path.insert(0, "/opt/xensource/sm")
20-
sys.path.insert(0, "/opt/xensource/sm/snapwatchd")
2120
import util
22-
import xslib
21+
import xen.lowlevel.xs
2322
import random
2423
import os
2524
from XenCertLog import XenCertPrint
@@ -70,8 +69,8 @@ for port in sampled_portlist:
7069
elif op == 'unblock':
7170
blockUnblockPort(False, ip, username, password, port)
7271

73-
xs_handle = xslib.get_xs_handle()
74-
xslib.setval(xs_handle, '/xencert/block-unblock-over', '1')
72+
xs_handle = xen.lowlevel.xs.xs()
73+
xs_handle.write('', '/xencert/block-unblock-over', '1')
7574
del xs_handle
7675

7776
if op == 'block':

src/XenCert/blockunblockiscsipaths

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
#
1818
import sys
1919
sys.path.insert(0, "/opt/xensource/sm")
20-
sys.path.insert(0, "/opt/xensource/sm/snapwatchd")
2120
import util
22-
import xslib
21+
import xen.lowlevel.xs
2322
import random
2423

2524
def help():
@@ -70,9 +69,10 @@ for ip in newList:
7069

7170
paths = paths.strip(',')
7271

73-
xs_handle = xslib.get_xs_handle()
74-
xslib.setval(xs_handle, '/xencert/block-unblock-over', '1')
72+
xs_handle = xen.lowlevel.xs.xs()
73+
xs_handle.write('', '/xencert/block-unblock-over', '1')
7574
del xs_handle
75+
7676
if op == 'block':
7777
sys.stdout.write(paths)
7878
sys.exit(0)

src/XenCert/blockunblockpaths

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424

2525
import sys
2626
sys.path.insert(0, "/opt/xensource/sm")
27-
sys.path.insert(0, "/opt/xensource/sm/snapwatchd")
2827
import util
29-
import xslib
28+
import xen.lowlevel.xs
3029
import os
3130
import time
3231
from XenCertLog import Print, XenCertPrint
@@ -42,9 +41,9 @@ if len(sys.argv) != 5 and len(sys.argv) != 1 :
4241
help()
4342

4443
retVal = ''
45-
xs_handle = xslib.get_xs_handle()
46-
xslib.setval(xs_handle, '/xencert/block-unblock-over', '0')
47-
block_unblock_over = xslib.getval(xs_handle, '/xencert/block-unblock-over')
44+
xs_handle = xen.lowlevel.xs.xs()
45+
xs_handle.write('', '/xencert/block-unblock-over', '0')
46+
block_unblock_over = xs_handle.read('', '/xencert/block-unblock-over')
4847
if len(sys.argv) == 5:
4948
cmd = [sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]]
5049
XenCertPrint('blockunblockpaths - now call %s and wait for block/unblock to finish.' % cmd)
@@ -58,7 +57,7 @@ elif len(sys.argv) == 1:
5857

5958
while block_unblock_over != '1':
6059
time.sleep(1)
61-
block_unblock_over = xslib.getval(xs_handle, '/xencert/block-unblock-over')
60+
block_unblock_over = xs_handle.read('', '/xencert/block-unblock-over')
6261

6362
os.system('xenstore-rm /xencert')
6463
del xs_handle

0 commit comments

Comments
 (0)