tools: Fix some errors after the name to target renames
authorStratos Psomadakis <psomas@grnet.gr>
Wed, 16 May 2012 23:03:01 +0000 (02:03 +0300)
committerStratos Psomadakis <psomas@grnet.gr>
Wed, 6 Jun 2012 11:52:53 +0000 (14:52 +0300)
(Need a lot more fixes to bring the up-to-date with the new code)

xseg/tools/vlmc-blockd.py
xseg/tools/vlmc-filed.py

index d0a3902..0d4a415 100755 (executable)
@@ -47,7 +47,7 @@ def vlmc_unmap(args):
     try:
         for f in os.listdir(XSEGBD_SYSFS + "devices/"):
             d_id = open(XSEGBD_SYSFS + "devices/" + f + "/id").read().strip()
-            name = open(XSEGBD_SYSFS + "devices/"+ f + "/name").read().strip()
+            name = open(XSEGBD_SYSFS + "devices/"+ f + "/target").read().strip()
             if device == DEVICE_PREFIX + d_id:
                 fd = os.open(XSEGBD_SYSFS + "remove", os.O_WRONLY)
                 os.write(fd, d_id)
@@ -66,7 +66,7 @@ def vlmc_showmapped(args):
     try:
         for f in os.listdir(XSEGBD_SYSFS + "devices/"):
             d_id = open(XSEGBD_SYSFS + "devices/" + f + "/id").read().strip()
-            name = open(XSEGBD_SYSFS + "devices/"+ f + "/name").read().strip()
+            name = open(XSEGBD_SYSFS + "devices/"+ f + "/target").read().strip()
 
             print "%s\t%s\t%s\t%s\t%s" % (d_id, '-', name, '-', DEVICE_PREFIX +
             d_id)
index 45feffa..365331a 100755 (executable)
@@ -33,7 +33,7 @@ def vlmc_unmap(args):
     try:
         for f in os.listdir(XSEGBD_SYSFS + "devices/"):
             d_id = open(XSEGBD_SYSFS + "devices/" + f + "/id").read().strip()
-            name = open(XSEGBD_SYSFS + "devices/"+ f + "/name").read().strip()
+            name = open(XSEGBD_SYSFS + "devices/"+ f + "/target").read().strip()
             if device == DEVICE_PREFIX + d_id:
                 fd = os.open(XSEGBD_SYSFS + "remove", os.O_WRONLY)
                 os.write(fd, d_id)
@@ -52,9 +52,9 @@ def vlmc_showmapped(args):
     try:
         for f in os.listdir(XSEGBD_SYSFS + "devices/"):
             d_id = open(XSEGBD_SYSFS + "devices/" + f + "/id").read().strip()
-            name = open(XSEGBD_SYSFS + "devices/"+ f + "/name").read().strip()
+            target = open(XSEGBD_SYSFS + "devices/"+ f + "/target").read().strip()
 
-            print "%s\t%s\t%s\t%s\t%s" % (d_id, '-', name, '-', DEVICE_PREFIX +
+            print "%s\t%s\t%s\t%s\t%s" % (d_id, '-', target, '-', DEVICE_PREFIX +
             d_id)
     except Exception, reason:
         print >> sys.stderr, reason