Package archipelagentvmcasting :: Module appliancedecompresser :: Class TNApplianceDecompresser
[hide private]
[frames] | no frames]

Class TNApplianceDecompresser

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        TNApplianceDecompresser

Instance Methods [hide private]
 
__init__(self, working_dir, disk_exts, xvm2_package_path, entity, finish_callback, error_callback, package_uuid, requester)
Initialize a TNApplianceDecompresser.
source code
 
run(self)
Run the thread.
source code
boolean
unpack(self)
Unpack the given xvm2 package.
source code
 
update_description(self)
Define the uuid to write in the description file.
source code
 
recover_snapshots(self)
Recover any snapshots.
source code
 
install(self)
Install a untared and uuid defined package.
source code
 
_gunzip(self, fileobjin, fileobjout)
Returns NamedTemporaryFile with unzipped content of fileobj.
source code
 
clean(self)
Clean the tempory path.
source code

Inherited from threading.Thread: __repr__, daemon, getName, ident, isAlive, isDaemon, is_alive, join, name, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon, _set_ident

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, working_dir, disk_exts, xvm2_package_path, entity, finish_callback, error_callback, package_uuid, requester)
(Constructor)

source code 

Initialize a TNApplianceDecompresser.

Parameters:
  • working_dir (string) - the base dir where TNApplianceDecompresser will works
  • disk_exts (array) - contains all the extensions that should be considered as a disks with the initial dot (ie: .gz)
  • xvm2_package_path (string) - path of the xvm2 file
  • entity (TNArchipelVirtualMachine) - the virtual machine
  • finish_callback (function) - called when decompression is done sucessfully
  • error_callback (function) - called when decompression has failed
  • package_uuid (string) - UUID of the package
  • requester (xmpp.Protocol.JID) - the JID of the requester
Overrides: object.__init__

run(self)

source code 

Run the thread.

Overrides: threading.Thread.run

unpack(self)

source code 

Unpack the given xvm2 package.

Returns: boolean
True in case of success

update_description(self)

source code 

Define the uuid to write in the description file.

Returns:
True in case of success
Raises:
  • Exception - Exception if description file is empty

install(self)

source code 

Install a untared and uuid defined package.

Returns:
True in case of success

_gunzip(self, fileobjin, fileobjout)

source code 

Returns NamedTemporaryFile with unzipped content of fileobj.

Parameters:
  • fileobjin (File) - file containing the archive
  • fileobjout (File) - file where to put the unziped file