Exemple #1
0
 def __init__(self, args, cmd_list, sep, cmd_map):
     CommandQueue.__init__(self, cmd_list, sep, cmd_map)
     self.args = args
     self.cmd_line = None
     self.init_blkdev = None
     self.init_vol = None
     self.blkdev = None
     self.volume = None
Exemple #2
0
 def run(self):
   self.img = self.args.image_file
   try:
     # main command loop
     exit_code = CommandQueue.run(self)
   except FSError as e:
     cmd = "'%s'" % " ".join(self.cmd_line)
     print(cmd, "FSError:", str(e))
     exit_code = 3
   except IOError as e:
     cmd = "'%s'" % " ".join(self.cmd_line)
     print(cmd, "IOError:", str(e))
     exit_code = 4
   finally:
     # close rdisk
     if self.rdisk != None:
       self.rdisk.close()
       if self.args.verbose:
         print("closing rdisk:", self.img)
     # close blkdev
     if self.blkdev != None:
       self.blkdev.close()
       if self.args.verbose:
         print("closing image:", self.img)
   return exit_code
Exemple #3
0
 def run(self):
     self.img = self.args.image_file
     try:
         # main command loop
         exit_code = CommandQueue.run(self)
     except FSError as e:
         cmd = "'%s'" % " ".join(self.cmd_line)
         print cmd, "FSError:", e
         exit_code = 3
     except IOError as e:
         cmd = "'%s'" % " ".join(self.cmd_line)
         print cmd, "IOError:", e
         exit_code = 4
     finally:
         # close volume
         if self.volume != None:
             self.volume.close()
             if self.args.verbose:
                 print "closing volume:", self.img
         # close blkdev
         if self.blkdev != None:
             self.blkdev.close()
             if self.args.verbose:
                 print "closing image:", self.img
     return exit_code
Exemple #4
0
 def run(self):
     self.img = self.args.image_file
     try:
         # main command loop
         exit_code = CommandQueue.run(self)
     except FSError as e:
         cmd = "'%s'" % " ".join(self.cmd_line)
         print(cmd, "FSError:", str(e))
         exit_code = 3
     except IOError as e:
         cmd = "'%s'" % " ".join(self.cmd_line)
         print(cmd, "IOError:", str(e))
         exit_code = 4
     finally:
         # close rdisk
         if self.rdisk != None:
             self.rdisk.close()
             if self.args.verbose:
                 print("closing rdisk:", self.img)
         # close blkdev
         if self.blkdev != None:
             self.blkdev.close()
             if self.args.verbose:
                 print("closing image:", self.img)
     return exit_code
Exemple #5
0
 def run(self):
   self.img = self.args.image_file
   try:
     # main command loop
     exit_code = CommandQueue.run(self)
   except FSError as e:
     cmd = "'%s'" % " ".join(self.cmd_line)
     print cmd,"FSError:",e
     exit_code = 3
   except IOError as e:
     cmd = "'%s'" % " ".join(self.cmd_line)
     print cmd,"IOError:",e
     exit_code = 4
   finally:
     # close volume
     if self.volume != None:
       self.volume.close()
       if self.args.verbose:
         print "closing volume:",self.img
     # close blkdev
     if self.blkdev != None:
       self.blkdev.close()
       if self.args.verbose:
         print "closing image:",self.img
   return exit_code
Exemple #6
0
 def run(self):
     self.img = self.args.image_file
     try:
         # main command loop
         exit_code = CommandQueue.run(self)
     except FSError as e:
         cmd = "'%s'" % " ".join(self.cmd_line)
         print(cmd, "FSError:", e)
         exit_code = 3
     except IOError as e:
         cmd = "'%s'" % " ".join(self.cmd_line)
         print(cmd, "IOError:", e)
         exit_code = 4
     finally:
         self._close_all()
     return exit_code
Exemple #7
0
 def __init__(self, args, cmd_list, sep, cmd_map):
   CommandQueue.__init__(self, cmd_list, sep, cmd_map)
   self.args = args
   self.blkdev = None
   self.rdisk = None
Exemple #8
0
 def __init__(self, args, cmd_list, sep, cmd_map):
     CommandQueue.__init__(self, cmd_list, sep, cmd_map)
     self.args = args
     self.blkdev = None
     self.rdisk = None